I have a sequence of images I would like to animate in beamer
. In each frame, I would like to have two images, say A and B, aligned vertically and centred on the page. All images are the same size.
I tried aligning the images using \vspace{}
, but then the vertical spaces accumulate and the images slide down as I transition through them.
How should I align the images in each frame?
Here is a minimal working example:
\documentclass{beamer}
\begin{document}
\frame{
\begin{figure}[t!]
\includegraphics<1>[scale=.5]{fig/imageA1} \vspace{.1in}
\includegraphics<1>[scale=.5]{fig/imageB1}
\includegraphics<2>[scale=.5]{fig/imageA2} \vspace{.1in}
\includegraphics<2>[scale=.5]{fig/imageB2}
\includegraphics<3>[scale=.5]{fig/imageA3} \vspace{.1in}
\includegraphics<3>[scale=.5]{fig/imageB3}
\includegraphics<4>[scale=.5]{fig/imageA4} \vspace{.1in}
\includegraphics<4>[scale=.5]{fig/imageB4}
\end{figure}
}
\end{document}
Best Answer
Using floating environments (such as
figure
ortable
) in a frame does not work in the way it should. To accomplish your objective, turn onallowpagebreak
andT
. Adjust the graphics withheight
option. See the code below for the remaining.For creating GIF animation see my other answer here.