2

enter image description here

When inserting nested lists inside the beamer package the vertical spacing between the items is not equal -- i.e. inconsistent.

What is the reason for this behaviour?

And is there a way to avoid the problem without additional packages, or obscure trickery (e.g. proposed by JorgeGT)?

\documentclass{beamer}
\begin{document}

\begin{frame}{No problem} \begin{itemize} \item MMMMMM \item MMMMMM \item MMMMMM \end{itemize} \end{frame}

\begin{frame}{Vertical item distance not consistent} \begin{itemize} \item MMMMMM \item MMMMMM \item MMMMMM \begin{itemize} \item MMMMMM \begin{itemize} \item MMMMMM \item MMMMMM \item MMMMMM \end{itemize} \item MMMMMM \item MMMMMM \end{itemize} \end{itemize} \end{frame}

\begin{frame}{Solution (kinda?!)} \begin{itemize} \item MMMMMM \item MMMMMM \item MMMMMM % next blank line seems to kinda solve the problem

\begin{itemize} \item MMMMMM \begin{itemize} \item MMMMMM \item MMMMMM \item MMMMMM \end{itemize} \item MMMMMM \item MMMMMM \end{itemize} \end{itemize} \end{frame}

\end{document}

alex
  • 985

1 Answers1

4

The reason of the bug (p.113, beameruserguide.pdf):

This template [itemize/enumerate body begin] is inserted at the beginning of a first-level itemize or enumerate environment. Furthermore, before this template is inserted, the beamer -font and -color itemize/enumerate body is used.

So \itemize change the color and the size of the font before the \list macro switches from horizontal mode to vertical mode...

Workaround: you can patch \itemize and \enumerate (in your preamble):

\usepackage{etoolbox}
\pretocmd{\itemize}{\vskip 0pt}{}{}
\pretocmd{\enumerate}{\vskip 0pt}{}{}
Paul Gaborit
  • 70,770
  • 10
  • 176
  • 283