[Tex/LaTex] Removing superfluous space after equations at end of beamer items

beamerequationsitemizespacing

I am trying to write an itemized list in a beamer frame, with additional space between items. As a consequence the space between an item ending with a formula and the next item is extra large, as the additional space from \vfill is compounded with the lower whitespace of the bounding box. This can be seen in the following MWE:

\documentclass{beamer}
\usetheme{Berkeley}
\usepackage{amsmath,amssymb,amsfonts}

\begin{document}

\frame{
    \frametitle{Test frame}

    \begin{itemize}
        \item This is a test file for the alignment of equations
        \vfill
        \item at the end of items: Here is an equation array
        \begin{equation*}
            A = B + C
        \end{equation*}
        \vfill
        \item Here no equation follows
        \vfill
        \item Now we have an align environment
        \begin{align*}
             A & = B + C \\
             D & = E - F
        \end{align*}
        \vfill
        \item And this is the last line   
    \end{itemize}
}
\end{document}

enter image description here

While I understand the logic behind these extra large vertical spacing, at least to me this looks esthetically not optimal. As TeX is usually so well thought out, I assume that there is some standardized way to address this issue. My questions are

  1. Is there a standard way to deal with this issue of extra space after equations ending an item? Is there even a standard setting suggesting which size of space is visually most pleasing (e.g., by what ratio should the length of \belowdisplayskip be reduced when finishing an item)?

  2. If there is not a standard way, what is the advised way to customize globally without breaking any of the other workings of beamer?

While both topics, changing space at separation of items and bounding boxes for equations are discussed in many questions, I could not find any that addressed them in combination. If adjusting the spacing around equations as outlined at How to globally change the spacing around equations?, this affects also equations in the middle of an item (which should stay as they are). If adjusting the space between items as suggested at Global setting of spacing between items in itemize environment for beamer, then also breaks of other items are enlarged, not only those ending with an equation.

EDIT: Adding from the comments: I have in total around 300 slides, being the total of all slides of a course, that I try to polish before giving them as a single file to the students (they have already the files of each lasses content, but I prefer to provide also a version presenting the whole course in a single file). In my opinion some of the slides do not look good without additional spacing. I tried to focus in my MWE on the direct problem of cumulation of spaces, not to provide the worst example of a not well spaced slide.

Best Answer

I was having the same problem as you and found this page. Basically, simply add

\makeatletter
\g@addto@macro\normalsize{%
    \setlength\belowdisplayskip{-0pt}
}

and it works fine!

Your full example would look like

\documentclass{beamer}
\usetheme{Berkeley}
\usepackage{amsmath,amssymb,amsfonts}

\makeatletter
\g@addto@macro\normalsize{%
    \setlength\belowdisplayskip{-0pt}
}

\begin{document}

\frame{
    \frametitle{Test frame}

    \begin{itemize}
        \item This is a test file for the alignment of equations
        \vfill
        \item at the end of items: Here is an equation array
        \begin{equation*}
            A = B + C
        \end{equation*}
        \vfill
        \item Here no equation follows
        \vfill
        \item Now we have an align environment
        \begin{align*}
             A & = B + C \\
             D & = E - F
        \end{align*}
        \vfill
        \item And this is the last line   
    \end{itemize}
}
\end{document}