# Beamer: Split Align Environment Across Multiple Slides

I have the following slide:

\documentclass{beamer}

\mode<presentation> {
\usecolortheme[RGB={0,0,0}]{structure}
}

\usepackage{amsmath,amsfonts,graphicx}
\usepackage{algpseudocode}
\usepackage{tikz}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\begin{document}
\begin{frame}
\frametitle{Example: $\Omega$-Notation}
\uncover<+->{{\bf Solution:}}
\begin{align*}
\uncover<+->{\log(n!) &= \log(\prod_{i=1}^{n} i) = \sum_{i=1}^{n} \log i \\}
\uncover<+->{&\geq \sum_{i={\frac{n}{2} + 1}}^{n} \log i \qquad \forall n \geq 1 \\}
\uncover<+->{&\geq \sum_{i={\frac{n}{2} + 1}}^{n} \log{(\frac{n}{2})} \qquad \forall n \geq 1 \\}
\uncover<+->{&= \frac{n}{2} \log(\frac{n}{2}) = \frac{n}{2} (\log n - 1) \\}
\uncover<+->{&\geq \frac{n}{2}(\log n - \frac{1}{2}\log n) \qquad \forall n \geq 4 \\}
\uncover<+->{&= \frac{1}{4}n \log n \\}
\end{align*}
\end{frame}
\end{document}


The problem is that there are to many equations to fit nicely on the slide (some are omitted here). Now I would like to split this into two slides, but making sure that the equations remained aligned consistently across both slides. I have seen a few possible solutions, but none appear to work with uncover.

• Please complete your code so we can compile it. Note that \bf and friends are obsolete 20+ years or so for LaTeX purposes. – cfr May 14 '16 at 0:27
• Added the header stuff. – user340082710 May 14 '16 at 1:37

You can "fake" the alignment on a new page with \phantom{}. But as the align environment is centred in the middle of the slide, this has to be done for both sides of the equation. I think the easiest is to take the longest expressions for both sides and add phantoms of them to all slides, see the last lines in the frames.

\documentclass{beamer}

\mode<presentation> {
\usecolortheme[RGB={0,0,0}]{structure}
}

\usepackage{amsmath,amsfonts,graphicx}
\usepackage{algpseudocode}
\usepackage{tikz}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\begin{document}
\begin{frame}[t]
\frametitle{Example: $\Omega$-Notation}
\uncover<+->{{\bf Solution:}}
\begin{align*}
\uncover<+->{\log(n!) &= \log(\prod_{i=1}^{n} i) = \sum_{i=1}^{n} \log i \\}
\uncover<+->{&\geq \sum_{i={\frac{n}{2} + 1}}^{n} \log i \qquad \forall n \geq 1 \\}
\uncover<+->{&\geq \sum_{i={\frac{n}{2} + 1}}^{n} \log{(\frac{n}{2})} \qquad \forall n \geq 1 \\}
\uncover<+->{&= \frac{n}{2} \log(\frac{n}{2}) = \frac{n}{2} (\log n - 1) \\}
\phantom{\log(n!)} & \phantom{\geq \frac{n}{2}(\log n - \frac{1}{2}\log n) \qquad \forall n \geq 4}
\end{align*}
\end{frame}

\begin{frame}[t]
\frametitle{Example: $\Omega$-Notation}
\uncover<+->{{\bf Solution:}}
\begin{align*}
\uncover<+->{&\geq \frac{n}{2}(\log n - \frac{1}{2}\log n) \qquad \forall n \geq 4 \\}
\uncover<+->{&= \frac{1}{4}n \log n \\}
\phantom{\log(n!)} & \phantom{\geq \frac{n}{2}(\log n - \frac{1}{2}\log n) \qquad \forall n \geq 4}
\end{align*}
\end{frame}
\end{document}


• This does not work. The alignment obtained is not consistent with what's on the previous slide. – user340082710 May 14 '16 at 21:03
• @user340082710 Can you explain, in which sense the alignment is not consistent? I added a screenshot, at least the equal signs seem to be aligned. – user36296 May 14 '16 at 22:18
• When I copy paste your example, things are aligned perfectly. But in mine, this are not aligned by the same vertical axis as in your picture. This occurs when I delete the last two lines from the first slide (as they are duplicated). – user340082710 May 14 '16 at 22:35
• But I do not understand why this happens. – user340082710 May 14 '16 at 22:37
• @user340082710 Ah, I see. The difference with deleting the last two lines is, that the longest line is not anymore on the first page and since the alignment is centred, that causes the difference. So there are a couple of options: a) go for left aligned math b) also fake the alignment for the right side (see my edit) – user36296 May 14 '16 at 22:46