[Tex/LaTex] Problem with using pause and onslide in one frame

alignbeamerpause

I'm trying to use \pause in align mode but it's not working. I ended up using onslide which it works fine. However, when I use both of them in one frame, some of onslide work while the other are not. This is a minimal example to regenerate the problem.

\documentclass[t]{beamer}

\usepackage{amsmath}

\begin{document}

\begin{frame}
AAAAA CCCCCC \\
\pause 
AAAAA CCCCCC
\begin{align*}
    \onslide<1->{a &= b \\}
    \onslide<2->{b &= c \\}
    \onslide<3>{ a &= c}
\end{align*}
\end{frame}

\end{document}

As you can see, the first two lines show up together. While the third line appears in the next slide. When I comment out \pause, the problem goes away. How to overcome this issue?

Best Answer

The "problem" is, that the first pause already creates an overlay, so you have to start counting at 2 in the align and not at 1. But to make this more flexible, simply don't use hard coded numbers but relative overlays.

\documentclass[t]{beamer}

\usepackage{amsmath}

\begin{document}

\begin{frame}
AAAAA CCCCCC \\
\pause 
AAAAA CCCCCC
\begin{align*}
    \onslide<+->{a &= b \\}
    \onslide<+->{b &= c \\}
    \onslide<+>{ a &= c}
\end{align*}
\end{frame}

\end{document}