I'm writing a beamer presentation, and trying (unsuccessfully) to use \pause
to step through a numbered array of equations, with the equations appearing in turn, and the corresponding numbers appearing at the correct time (i.e. when the equation first appears).
edit: I have partially solved the problem, using a variant on the \alt
trick described here, but with some vertical wiggling.
The solution ought to be a little more elegant than the one I've proposed below, given that the end user of the document (not me) is likely to need to make changes, and is not an advanced (La)TeX-user.
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{gather}
1\alt<2->{\\2\alt<3>{\\3}{}}{}
\end{gather}
\end{frame}
\end{document}
Best Answer
In the
beamer
user guide, in the explanation of\pause
it says:The wicked thing that
align
,gather
and friends do is that they evaluate the contents of the environment twice. In particular, overlay commands such as\pause
are executed twice, which can cause mayhem. In the first run, the contents of the environment are just measured; the actual typesetting is done in the second run.Since the measuring in the first run starts with
\begingroup \measuring@true
, the problem can be fixed quite easily (although according to thebeamer
user guide "there is no fix for this"!): just let\measuring@true
deactivate the appropriate overlay commands. (Of course one has to find out what exactly to deactivate ...) The code below does this, giving the desired output: