[Tex/LaTex] \alert within align in Beamer

amsmathbeamer

I am trying to use alert within the AMS-math align environment, so that sets of equations uncover sequentially and are highlighted. I would expect something like this to work:

\begin{align}
\alert<1>{a &= b+c} \\
\alert<1>{a &= b+c} \\ \pause
\alert<2>{a &= b+c} \\
\alert<2>{a &= b+c} \\
\end{align}

by highlighting the first two equations in the first slide and the next two in the next slide. I am doing something wrong? Or is there a different way to get this to work?

Best Answer

It's explained in the Beamer manual, section 23.4:

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{align}
\uncover<1->{\alert<1>{a} &\alert<1>{= b+c} \\}
\uncover<1->{\alert<1>{a} &\alert<1>{= b+c} \\}
\uncover<2->{\alert<2>{a} &\alert<2>{= b+c} \\}
\uncover<2->{\alert<2>{a} &\alert<2>{= b+c} \\}
\notag
\end{align}
\end{frame}
\end{document}

This leaves a vertical space at the end of the display, a \vspace{-1.2\baselineskip} or so can remove it.

You can't say \alert<1>{a&=b+c} because this confuses the align scanning mechanism.