5

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.

  • 2
    The issue is that you're using \vfill, which inserts the stretchable space in addition to the standard space below an equation. However, removing \belowdisplayskip would still produce unbalanced spacings. Why would you fill the slide anyway? You get worse spacing. – egreg Jan 2 '17 at 12:18
  • 1
    Trying to increase the readability. I try to put not too much items on one slide to keep it easier for the reader to follow. But with only 3-4 2-3 line items, beamer is clustering them which feels to me less easily readable than a more spaced version. – Stephan Sturm Jan 2 '17 at 12:21
  • 2
    If I visually compare the slides with and without \vfill, I have the impression that the latter is much better. Large white space is distracting, in my opinion. You may want to reduce the values for \abovedisplayskip and \belowdisplayskip. – egreg Jan 2 '17 at 12:29
  • 1
    To me, your slide with all \vfills removed seems more than perfect! – AboAmmar Jan 2 '17 at 12:36
  • Sorry that I was not clear about this. I have in total ~ 300 slides, I try to repackage the slides from a class I gave to provide the students with a single file to browse through. In this process, besides eliminating typos etc. I am trying also to improve the appearnce. Some of the slights do not look good without some additional separation as \vspace{10pt} or \vfill. – Stephan Sturm Jan 2 '17 at 12:41
2

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}
  • 1
    this reduces the space after all equations, not only the ones at the end of an item, which will create too short spaces in other places. – Ur Ya'ar Jan 24 at 9:26
0

You could use the enumitem package and change itemsep:

\documentclass{beamer}
\usetheme{Berkeley}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{enumitem}
\setitemize{itemsep=2ex,label=\usebeamerfont*{itemize item}%
  \usebeamercolor[fg]{itemize item}
  \usebeamertemplate{itemize item}}

\begin{document}

\frame{
    \frametitle{Test frame}

    \begin{itemize}
        \item This is a test file for the alignment of equations
        \item at the end of items: Here is an equation array
        \begin{equation*}
            A = B + C
        \end{equation*}
        \item Here no equation follows
        \item Now we have an align environment
        \begin{align*}
             A & = B + C \\
             D & = E - F
        \end{align*}
        \item And this is the last line   
    \end{itemize}
}
\end{document}
  • 4
    enumitem is not really compatible with beamer. – egreg Jan 2 '17 at 12:26
  • enumitem destroys the overlay feature of beamer. If you don't need such overlays, it is ok to use enumitem, but not recommended – user31729 Jan 2 '17 at 12:29
  • It turns out this breaks quite a couple of feature of the slides, most importantly that some of the longer slides do not fit anymore on one page. Thank you nevertheless for proposing this idea! – Stephan Sturm Jan 2 '17 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.