# \pause messes up the page layout

I'm having a frame in beamer which compiles just right when I do not use pauses (\pause). However, when I pause the different list items, the last items do not appear on the frame anymore (actually, they are outside the frame viewable part). It seems in some way beamer has some problem calculating how to fit the different items on the page when pauses are included.

Any idea how to avoid this problem?

EDIT : Some source code exhibiting the problem :

\documentclass[slidetop,11pt]{beamer}
\begin{document}

\begin{frame}{Kubo-Greenwood Transport Formalism : Derivation}
Mott Method :
\begin{itemize}
\pause \item Electric field :
\footnotesize
\begin{equation*}
E(t) = E_0 cos(\omega t) u_x
\end{equation*}
\normalsize
\pause \item Coulomb gauge ($E=\delta A / \delta t$) :
\footnotesize
\begin{equation*}
A(t) = -\frac{E_0}{2 i \omega} (e^{i \omega t} - e^{-i \omega t}) u_x
\end{equation*}
\normalsize
\pause \item First order perturbation of H :
\footnotesize
\begin{equation*}
\delta \widehat{H} (t) = \frac{2e \widehat{P}.A(t)}{2 m} = e \widehat{V}.A(t) = -\frac{e     E_0}{2 i \omega}(e^{i\omega t} - e^{-i \omega t}) \widehat{V}_x
\end{equation*}
\normalsize
\pause \item Transition from a state at t=0 to a state at t :
\footnotesize
\begin{equation*}
p_{nm} (t) = \frac{1}{\hbar^2} \left |\int_0^t d\tau e^{i(E_m-E_n) \tau / \hbar} \langle    m|\delta \widehat{H}(\tau)|n \rangle \right |^2
\end{equation*}
\normalsize
\pause \item At long times :
\footnotesize
\begin{equation*}
\frac{p_{nm}(t)}{t}  = \frac{2 \pi}{\hbar} \left(\frac{e2E_0}{2 \omega}\right)^2 \langle m|\widehat{V}_x|n \rangle \left[ \delta(E_m-E_n+\hbar \omega) +  \delta(E_m-E_n-\hbar     \omega)\right]
\end{equation*}
\normalsize
\end{itemize}
\end{frame}

\end{document}


And actually, thanks to your comment vanden to give a minimal amount of packages and comments, I managed to find the cause to this compilation error. It is the "\linespread{1.2}" command that messes things up when using \pause. If no fix available, I'll just comment it out I guess.

-
Could you post some minimal compilable code that exhibits the problem? (I.e., just enough code that someone else can run it and observe your issue, with all packages and content not needed to make the issue occur removed.) –  vanden Aug 11 '10 at 2:25
I edited as asked. And thanks for adding the pause tag, I tried but did not have enough reputation to create a new tag... –  Nigu Aug 11 '10 at 3:00

There is special syntax for item's - I've never tried pause with lists for that reason, but my guess is that it's causing trouble. Try removing all the pauses and replace \begin{itemize} with

\begin{itemize}[<+->]


This causes each item to be uncovered one by one. For more fine-grained control, instead of the above change, use e.g.

\item<3->


To make an item appear on slides 3 and above. There are other variants, see the Beamer user guide.

-
Tested this, and it seems to fix it. –  Neil Olver Aug 11 '10 at 4:59
Thank you. I heart of this syntax, but never used it... –  Nigu Aug 11 '10 at 5:13

That's some curious behaviour you observed! There's nothing inherently wrong in the syntax you use – I'll explain below why the output goes awry nevertheless. Neil's suggestion to use \begin{itemize}[<+->] is a great alternative to \pause in your example. If you want to use \pause all the same, then there's an easy fix: adding an empty line (or a \par) before the offending \pauses will remove the additional vertical space, i.e., with


\pause\item


everything will be alright!

So, what causes the unwanted vertical space, and why on earth does an additional empty line remove the space? The problem is the combination of the displayed equation before and the \item after the \pause: after the display, TeX goes into horizontal mode, ready to build a new line of text. (This means that \lastskip is the last horizontal skip, which is 0pt; see below.) The \pause puts some \pdfliterals onto that line, and the \item ends it with a \par. This already gives one \baselineskip additional vertical space. On top of that, the \item adds an \itemsep (since \lastskip is 0pt after the \par, see also below).

Without the \pause, these vertical spaces do not appear: the line following the displayed equation remains empty, so the \par doesn't add a \baselineskip. Moreover, the last vertical skip \lastskip is now \belowdisplayskip (or \belowdisplayshortskip), which is greater than an \itemsep, and \item is designed to not add \itemsep in this case.

And why does an empty line (i.e., a \par) before the \pause help? It ends the line that TeX started after the display, bringing TeX into vertical mode. That line is still empty, so no \baselineskip is added! Moreover, in vertical mode, \lastskip is again the last vertical skip \belowdisplay(short)skip. Now \pause does some \unskip magic so that the \pdfliterals don't influence the \lastskip. Then \item issues another \par, but this doesn't do anything since TeX is already in vertical mode. Finally, \lastskip is still the same as without the \pause, so the \item doesn't add \itemsep, either.

In summary: \pause may go awry in horizontal mode (when TeX builds lines and paragraphs), but it's safe to use in vertical mode¹. That's why, a \par before a \pause can help in certain circumstances.

Just for the fun of it, here's a redefinition of \pause that looks ahead and inserts the \par automatically if it sees an \item (or a \par):

\makeatletter
\AtBeginDocument{%
\let\saved@pause\pause
\renewcommand\pause{\futurelet\pause@next@char\pause@i}%
\newcommand\pause@i{%
\ifx\pause@next@char\par\par\fi
\ifx\pause@next@char\item\par\fi
\saved@pause
}%
}
\makeatother


¹However, at the top of a \vtop box, when TeX is in internal vertical mode, \pause can cause problems.

-