2

I am unable to find a way to do this using only or onslide. Please let me know if there is a way. I will try to explain what I want.

I want my 3rd slide to have two images : Image A and Image C exactly below it. However the Image A must be on all the 3 slides : in the exact same position. Additionally the second slide should have Image B right below Image A.

So 1st slide will have Image A, second slide will have Image A at the same position, Image B right below it and then the third slide should have Image A in the same position and Image B needs to disappear and Image C will arrive, starting at the same position.

I have tried :

\documentclass{beamer}
\usepackage{graphicx}
\title{try}
\begin{document}
\section{Introduction}
\begin{frame}{Slide}
    Text 1\\
    \onslide<2->{
    \only<2>{Text 2\\}
    \only<3>{Text 3}
    }
\end{frame}
\end{document}

However it doesn't work : the first slide has Image A in the middle, and then moves up. Note that the images are of different sizes.

1 Answers1

2

The easiest solution is to top-align your frame:

\documentclass{beamer}

\begin{document}

\begin{frame}[t] \includegraphics[width=3cm]{example-image-a}%

\includegraphics<2>[width=1cm]{example-image-b}% \includegraphics<3>[width=4cm]{example-image-c}% \end{frame}

\end{document}

enter image description here

If you don't want a top aligned frame, you could use the overlayarea environment. Just make sure that the height you choose is equal (or larger) than your tallest image:

\documentclass{beamer}

\begin{document}

\begin{frame} \includegraphics[width=3cm]{example-image-a}

\begin{overlayarea}{\linewidth}{4cm} \includegraphics<2>[width=1cm]{example-image-b} \includegraphics<3>[width=4cm]{example-image-c} \end{overlayarea} \end{frame}

\end{document}

enter image description here