6

I would like to display a frame in two steps:

  • first a block title
  • and then a picture underneath.

Here is my code:

\begin{frame}{title}
\begin{block}{blockTitle}<1->
\includegraphics<2->[width=\textwidth]{image.png}
\end{block}
\end{frame}

Unfortunately, this doesn't display things as I would like to. First it displays the block title in the middle of the frame. Then, it moves this block title up to let the image appear in the middle of the frame.

What I would like is first to have the block title appear at its definitive position and second have the picture appear underneath without the block title to move.

Of course, I could add [t] after the \begin{frame} to solve my problem but that would not place the block in the middle of the frame but rather at the top of it.

Corentin
  • 9,981
Rene
  • 125
  • 5

2 Answers2

8

A simple solution with \uncover:

\documentclass{beamer}

\begin{document}

\begin{frame}
\frametitle{A test frame}
\begin{block}{A block with an image}
\uncover<2>{\includegraphics[width=6cm]{example-image-a}}
\end{block}
\end{frame}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
4

You should specify an "empty complement" for the image that will be displayed on the first frame of the slide. Below I've used \only<1>{\phantom{..}} to insert and keep the space required so the other slide content doesn't move.

enter image description here

\documentclass{beamer}% http://ctan.org/pkg/beamer
\begin{document}
\begin{frame}{title}
  \begin{block}{blockTitle}<1->
    \only<1>{\phantom{\includegraphics[width=\linewidth,height=.3\textheight]{example-image-a}}}%
    \includegraphics<2->[width=\linewidth,height=.3\textheight]{example-image-a}
  \end{block}
\end{frame}
\end{document}

Note the use of % to avoid further "shaking" of content horizontally. See What is the use of percent signs (%) at the end of lines?

Werner
  • 603,163