Problem with beamer's \pause in alignments
From the beamer manual, in the middle of a use case:
Euclid finds that he can also add a
\pause
between the definition and the example. So,\pause
s seem to transcede environments, which Euclid finds quite useful. After some experimentation he finds that\pause
only does not work inalign
environments. He immediately writes an email about this to beamer’s author, but receives a polite answer stating that the implementation ofalign
does wicked things and there is no fix for this. Also, Euclid is pointed to the last part of the user’s guide, where a workaround is described. (emphasis added)
Here is my workaround, using \action
:
\documentclass{beamer}
\mode<presentation> { \setbeamercovered{transparent} }
\begin{document}
\begin{frame}
\[
\begin{cases}
\begin{aligned}
\action<+->{v(t,x) &= g(t,x), \\}
\action<+->{u(x)} &\action<.->{=f(x)} & \action<.->{(x\in\mathbb R)}
\end{aligned}
\end{cases}
\]
\end{frame}
\end{document}
It's surprising that the second line has to have each cell of the align enclosed in an action specification while the first line can go in a single one (maybe that has something to do with the fact that it's shown by default on all slides). But I remember Till's advice to Euclid:
align
does wicked things and there is no fix for this.
Added: \action
is a generic \only
if I recall correctly. And the incremental overlay specifications like <+->
are very much worth learning. See Section 8 of the beamer manual, or at least it's Section 8 of my 3.06 manual: "Creating Overlays."
Finally I followed Joseph's advice, and in the end found an easy fix for my problem: redefine \beamerorig@set@color
and \beamerorig@reset@color
to what they were before 2007. With the code below, the \pause
s work exactly like expected:
I also tested this with two sets of real-world slides, and encountered no unwanted side effects.
\documentclass{beamer}
\mode<presentation> { \setbeamercovered{transparent} }
\setbeamertemplate{navigation symbols}{}
\makeatletter
\def\beamerorig@set@color{%
\pdfliteral{\current@color}%
\aftergroup\reset@color
}
\def\beamerorig@reset@color{\pdfliteral{\current@color}}
\makeatother
\begin{document}
\begin{frame}
\[
\begin{cases}
\begin{aligned}
v(t,x)&= g(t,x), \\ \pause
u(x) &= f(x) & \pause
(x\in\mathbb R)
\end{aligned}
\end{cases}
\]
\end{frame}
\end{document}
So it might well be that "align
does wicked things" (see Matthew's answer), but before 2007, this was not relevant if \setbeamercovered{transparent}
was used, so for me, \pause
worked amazingly well within align
. (A fix for the case that \setbeamercovered{transparent}
is not used can be found in this answer of mine.)
And what happened in 2007? Version 0.04a of pdftex.def
was released, with support of color stacks. For this, new definitions of \set@color
and \reset@color
were used; these are what \beamerorig@set@color
and \beamerorig@reset@color
are \let
to in beamerbasecolor.sty
. And it appears that this color stack version doesn't work properly in align
and friends. In the code above, I used the definitions of \set@color
and \reset@color
form version 0.03t of pdftex.def
.
If you don't mind using eqnarray
in place of align
, then you can get the pauses to work.
At least that is my experience.