1

I have 3 images that are supposed to appear "replacing" each other on a beamer frame. I've been able to do that with overprint and onslide with no trouble. The problem is that one of the images is taller than the rest, so it appears shifted from the others. Since an image is better than a thousand words, I will illustrate what I mean bellow. The code is:

\begin{frame}{Problem description}
\begin{overprint}
    \onslide<1>\centering\includegraphics[scale=0.3]{figs/img_1.png}
    \onslide<2>\centering\includegraphics[scale=0.3]{figs/img_2.png}
    \onslide<3>\centering\includegraphics[scale=0.3]{figs/img_3.png}
\end{overprint}
\end{frame}

And my images are the ones below:

First image Second image, which aligns perfectly with the previous one Third image, which does not align because it is a little bit taller than the previous 2

The third image does not align because it is a little bit taller than the previous 2.

I believe that if I align the images using their bottom, I might get the "effect" of superposition that I want. Is there an easy way to do so?

1 Answer 1

2

As simple hack, you could use the tallest image in a \vphantom to make sure all your slides have the same height.

However the vertical alignment isn't your only problem: your last image is also wider.

\documentclass{beamer}

\begin{document}
    
\begin{frame}{Problem description}

\hfill\vphantom{\includegraphics[scale=0.3]{img_3}}%
\includegraphics<1>[scale=0.3]{img_1}%
\includegraphics<2>[scale=0.3]{img_2}%
\includegraphics<3>[scale=0.3]{img_3}%
\hspace{3cm}

\end{frame}
    
\end{document}

enter image description here

Or you could use a bottom aligned frame (it looks a bit empty like this, but maybe your real frame has more content):

\documentclass{beamer}

\begin{document}
    
\begin{frame}[b]
\frametitle{Problem description}

\hfill
\includegraphics<1>[scale=0.3]{img_1}%
\includegraphics<2>[scale=0.3]{img_2}%
\includegraphics<3>[scale=0.3]{img_3}%
\hspace{3cm}

\end{frame}
    
\end{document}

enter image description here

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.