18

I have a few very simple beamer slides, which are built up this way:

A short introducory text

A picture, which is almost the same in all slides

Unfortunately, the introducory text is sometimes one line, sometimes two lines and sometimes three. Therefore the picture gets always a little bit shifted in its vertical position. Since this is a presentation, I would it like to have it fixed on a certain position, so that it doesn't change when loading the new slide.

1
  • I reached here looking for a solution where the (variable) text and figure needed to be side by side. For such a case we can give the figure its own minipage devoid of any changing text. This would ensure that within the confines of its half, its position remains fixed.
    – ijuneja
    Nov 14, 2020 at 19:39

1 Answer 1

17

You could use the overprint environment so that the same space is reserved on all slides.

\begin{frame}
\frametitle<1>{Title for slide 1}
\frametitle<2>{Title for slide 2}
\frametitle<3>{Title for slide 3}

\begin{overprint}
  \onslide<1> introductory text for first slide
  \onslide<2> introductory text for second slide
  \onslide<3> introductory text for third slide
              \\can also be longer
\end{overprint}

\begin{overprint}
  \onslide<1>\centerline{\includegraphics[width=<length>]{filename1}}%
  \onslide<2>\centerline{\includegraphics[width=<length>]{filename2}}%
  \onslide<3>\centerline{\includegraphics[width=<length>]{filename3}}%
\end{overprint}

\end{frame}

Another simple idea is to add a \vfill between text and graphic to push both apart. Then the graphic will always be at the bottom. A third alternative is to use the textpos package to place the graphic using absolute coordinates.

2
  • This is golden, though for me the issue was for the longest time that I didn't pay attention to the % at the end of the lines. Adding those to the end of my \only{\includegraphics{filename}} solved my problems :)
    – tor
    Jun 17, 2016 at 11:14
  • 1
    For those who would like to replace the includegraphics with animations: place a single \begin{animateinline} before \onslide<1> (instead of using 3 \begin{animateinline}).
    – anderstood
    May 2, 2017 at 18:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .