Beamer: keep text position in consecutive frames (or how to get overprint to increment frame number)

You can trick beamer into increasing the framenumber in between the overlays.

\documentclass{beamer}

\begin{document}

\begin{frame}
Common text, that keeps its position in the two frames \\

\begin{overprint}

\onslide<1>
  First slide \\
  Frame - \insertframenumber{} of \inserttotalframenumber \\

\only<2>{\addtocounter{framenumber}{1}}

\onslide<2>
  Second slide \\
  Frame - \insertframenumber{} of \inserttotalframenumber \\
  Some more text

\end{overprint}
\end{frame}


\end{document}

enter image description here


Technically you're on the same frame, but a different slide. For this you should either separate the content on different frames making space or using boxes/\phantoms to replicate the overprint area:

\documentclass{beamer}

\let\Tiny\tiny% http://tex.stackexchange.com/a/94159/5764

\begin{document}

\begin{frame}
Common text, that keeps its position in the two frames

First slide \\
Frame - \insertframenumber{} of \inserttotalframenumber \\
\phantom{Some more text}

\end{frame}

\begin{frame}
Common text, that keeps its position in the two frames

Second slide \\
Frame - \insertframenumber{} of \inserttotalframenumber \\
Some more text

\end{frame}

\end{document}

Or, you can step the counter manually within the same frame:

\documentclass{beamer}

\let\Tiny\tiny% http://tex.stackexchange.com/a/94159/5764

\begin{document}

\begin{frame}
Common text, that keeps its position in the two frames

\begin{overprint}

\onslide<1>
  First slide \\
  Frame - \insertframenumber{} of \inserttotalframenumber \\

\only<2>{\stepcounter{framenumber}}

\onslide<2>
  Second slide \\
  Frame - \insertframenumber{} of \inserttotalframenumber \\
  Some more text

\end{overprint}
\end{frame}

\end{document}

I just got a solution with vbox:

\begin{frame} %1
\vbox to 0.13\textheight{%
 Common text \\
 }

\vbox to 0.45\textheight{%
  First slide \\
  Frame - \insertframenumber{} of \inserttotalframenumber \\
}
\end{frame}


\begin{frame} %2
\vbox to 0.13\textheight{%
 Common text \\
 }

\vbox to 0.45\textheight{%
  Second slide \\
  Frame - \insertframenumber{} of \inserttotalframenumber \\
  Some more text
}
\end{frame}

Tags:

Beamer