[Tex/LaTex] LaTeX Beamer: \pause doesn’t work in \align

alignbeamer

I would like \pause to work in align environements as it works with normal text. Here is an MWE:

\documentclass{beamer}
\begin{document}

\begin{frame}
\begin{align*}
    1+1 &= 2 \\  \pause
    1+2 &= 3 \\  \pause
    2+2 &= 4 
\end{align*}
\end{frame}

\end{document}

It causes three pages in the PDF, where only the second page has the second equation missing, otherwise all equations are always visible.

I know there are workarounds with \visible, but a working \pause would be the simplest solution.

Best Answer

The following snippet solves my problem. Put it somewhere in front of the \begin{document}:

\makeatletter
\let\save@measuring@true\measuring@true
\def\measuring@true{%
  \save@measuring@true
  \def\beamer@sortzero##1{\beamer@ifnextcharospec{\beamer@sortzeroread{##1}}{}}%
  \def\beamer@sortzeroread##1<##2>{}%
  \def\beamer@finalnospec{}%
}
\makeatother