beamer icon indicating copy to clipboard operation
beamer copied to clipboard

Nested itemize yields variable vertical space between items of the same level

Open josephwright opened this issue 10 years ago • 5 comments

Originally reported by: Hilmar Preuße (Bitbucket: hpreusse, GitHub: hpreusse)


This is https://bugs.debian.org/574605 in DBTS.

With the following example, one gets the following problems:

  • the vertical space between Item 2 and Item 3 is smaller than the one between Item 1 and Item 2,
  • the vertical space between Item 3.2 and Item 3.3 is smaller than the one between Item 3.1 and Item 3.2.

The vertical space between items of the same level should remain the same. Since beamer changes the font size, I wonder whether this problem is related to:

http://groups.google.com/group/comp.text.tex/browse_thread/thread/c675febb873cf73f/

Minimal LaTeX input file is attached.

regards, Hilmar

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usetheme{Madrid}

\begin{document}

\begin{frame}
  \begin{itemize}
  \item Item 1
  \item Item 2
  \item Item 3
    \begin{itemize}
    \item Item 3.1
    \item Item 3.2
    \item Item 3.3
      \begin{itemize}
      \item Item 3.3.1
      \item Item 3.3.2
      \end{itemize}
    \end{itemize}
  \end{itemize}
\end{frame}

\end{document}

  • Bitbucket: https://bitbucket.org/rivanvx/beamer/issue/306

josephwright avatar Sep 19 '14 21:09 josephwright

Non-trivial but does need fixing: release-after next, I hope.

josephwright avatar Nov 27 '16 15:11 josephwright

Hello. Unfortunately, this bug still exists in beamer v3.50. Can this issue be re-opened?

cebamps avatar Apr 22 '18 13:04 cebamps

@louisstuart96 Any idea why this got closed?

josephwright avatar Apr 22 '18 14:04 josephwright

This problem could be fixed by starting all itemize/enumeration in a new paragraph. For example

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usetheme{Madrid}

\begin{document}

\begin{frame}
  \begin{itemize}
  \item Item 1
  \item Item 2
  \item Item 3
  
    \begin{itemize}
    \item Item 3.1
    \item Item 3.2
    \item Item 3.3
 
      \begin{itemize}
      \item Item 3.3.1
      \item Item 3.3.2
      \end{itemize}
    \end{itemize}
  \end{itemize}
\end{frame}

\end{document}

works fine.

Would it be good idea to add \par somewhere to the itemize/enumeration environments?

ghost avatar Sep 07 '18 11:09 ghost

The nested environments change the font size before the \list macro makes TeX enter vertical mode, thus the \baselineskip is smaller for that line. One possible idea is to put \setbeamerfont (and \setbeamercolor) after the \list macro. The embracing body begin and body end template might be affected by this, but these templates are empty by default, and seldom used by common themes.

louisstuart96 avatar Sep 24 '18 13:09 louisstuart96