# Dancing images in beamer

When creating a slide using pauses and \only, I am getting cases where the content shifts between slides. I have tried using overlayarea and overprint as described in Avoiding jumping frames in beamer (in every combination I could think of - in one or the other or both columns, around the whole thing, using \only, using \onslide), but I still get dancing images.

Minimal example follows. Note, while debugging I am including the same image 5 times, but in our end document I will be using 5 different images (all the same size). [ Update: The dancing seems to happen on the slide where the visible portion of the itemize environment exceeds the height of the image, so this may depend on the image size ]

\documentclass[t]{beamer}
\usetheme{Singapore}
\usecolortheme{rose}

\begin{document}

\begin{frame}{Riverbend Community Math Center}
\begin{columns}[c]
\begin{column}{0.6\textwidth}
\begin{itemize}[<+->]
\item Founded in Summer of 2006
\item Centered in St.~Joseph County, Indiana
\item Independent, non-profit organization
\item Serves people ages 5 through adult
\item Promotes interest and confidence in mathematics
\end{itemize}
\end{column}

\begin{column}{0.4\textwidth}
\only<1>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<2>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<3>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<4>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<5>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\end{column}
\end{columns}
\end{frame}

\end{document}


For complete information, I am using XeLaTeX but see the same dancing when compiling with plain LaTeX.

-

This seems to be caused by the center alignment of the two columns (because you use {columns}[c]). I would change that to top alignment ([t]) and add \vspace{0cm} on top of the second column to create a narrow top line to which the first line of the first column is aligned to. This is basically the same solution as for Aligning image and text on top, with minipages and Vertical alignment of tikzpicture with text? just for beamer columns.

\documentclass[t]{beamer}
\usetheme{Singapore}
\usecolortheme{rose}

\begin{document}

\begin{frame}{Riverbend Community Math Center}
\begin{columns}[t]
\begin{column}{0.6\textwidth}
\begin{itemize}[<+->]
\item Founded in Summer of 2006
\item Centered in St.~Joseph County, Indiana
\item Independent, non-profit organization
\item Serves people ages 5 through adult
\item Promotes interest and confidence in mathematics
\end{itemize}
\end{column}

\begin{column}{0.4\textwidth}
\vspace{0cm}
\only<1>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<2>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<3>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<4>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<5>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\end{column}
\end{columns}
\end{frame}

\end{document}


Note that instead \only<n>{\includegraphics[...]{...}} you can also write \includegraphics<n>[...]{...} which should have the same effect, but is shorter.

-
* Thanks for the \includegraphics<n> comment - that one was not on the list of "temporalable" commands that I saw. –  Dean Serenevy May 11 '11 at 17:04
Oddly enough, using \includegraphics<n> is sufficient to solve the problem! There must be some magic there. –  Dean Serenevy May 11 '11 at 17:06
@Dean: It might be the spaces caused by the line breaks after \only<n>{...}! Always add a % when the line ends with } in such cases. –  Martin Scharrer May 11 '11 at 17:08
@Dean: Indeed! The spaces after \only<n>{...} are causing the "dancing". Simply write \only<n>{...}% instead or use \includegraphics<n>... which includes a trailing \ignorespaces (in the redefined form of beamer). –  Martin Scharrer May 11 '11 at 17:16
Trailing %: Oh how terribly silly, yes, I know that issue and should have thought of it. Adding trailing % to the \only lines is also sufficient to fix the original code. Thank you very much for your help! –  Dean Serenevy May 11 '11 at 17:18
show 1 more comment

Try an overlayarea environment like this:

\documentclass[t]{beamer}
\usetheme{Singapore}
\usecolortheme{rose}

\begin{document}

\begin{frame}{Riverbend Community Math Center}
\begin{columns}[c]
\begin{column}{0.6\textwidth}
\begin{overlayarea}{\textwidth}{0.7\textheight}
\begin{itemize}[<+->]
\item Founded in Summer of 2006
\item Centered in St.~Joseph County, Indiana
\item Independent, non-profit organization
\item Serves people ages 5 through adult
\item Promotes interest and confidence in mathematics
\end{itemize}
\end{overlayarea}
\end{column}
\begin{column}{0.4\textwidth}
\begin{overlayarea}{\textwidth}{0.7\textheight}
\only<1>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<2>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<3>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<4>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\only<5>{\includegraphics[width=\textwidth]{RiverbendCommunityMathCenter}}
\end{overlayarea}
\end{column}
\end{columns}
\end{frame}

\end{document}

-
This breaks vertical centering of the second column. –  Dean Serenevy May 11 '11 at 17:08