7

I am building a presentation in Beamer.

The presentation contains a slide where an image should be displayed on the top of the frame. Underneath some text should be displayed containing information about the image. The text should change frame by frame (other information, no overlays). Therefore the image needs to stay on it's initial place of course.

Are there any ways to do this, or is there some workaround (elegant solution)?

4

I believe this is a better solution, which makes sure that the text, under the picture, will be kept in place.

\begin{frame}{Test}
\begin{center}
    \includegraphics[width=0.8\linewidth]{bird.jpg}
  \end{center}

\begin{center}
    \begin{overprint}
        \onslide<1>
            Text for the first slide.\\
            Maybe few lines\\
        long...
        \onslide<2>
            Replacement on the second slide.\\
        This time only two lines.
    \end{overprint}
\end{center}
\end{frame}
2

If the text is below the image, this shouldn't be to much of a problem.

\begin{frame}
  \begin{center}
    \includegraphics{foo.pdf}
  \end{center}

  \uncover<+>{text on first slide}%
  \uncover<+>{text on second slide}%
  \uncover<+>{text on third slide}

\end{frame}

What's more challenging is a situation where the static material is below the dynamic material. Then you have to put the dynamic material in a box that is the same size on each slide. The most common ways to do that are with the overlay and overprint environments (see the beamer manual).

  • I am looking for some structure so the text on the first slide dissapears when the second uncovers. This text also should be on the same place. – Willem Van Onsem Dec 20 '10 at 6:26
  • @CommuSoft: That should happen with the example above. The <+> overlay specification means increment the pause counter and display only for the slide corresponding to that counter. – Matthew Leingang Dec 20 '10 at 10:06
  • @Matthew: With your code, the text under the figure does not stay in the same place. Actually, if you insert a line break in to the second slide's text, then it looks bad. With your example, the text does jump around. However, I don't know how to cure it... – Dror Dec 22 '10 at 12:35
  • @Dror: sure, because the baseline is important. Use a tabular her:<pre>\PassOptionsToPackage{demo}{graphicx} \documentclass{beamer} \def\tab#1{\tabular[t]{@{}l@{}}#1\endtabular} \begin{document} \begin{frame} \begin{center} \includegraphics{foo.pdf} \end{center} \uncover<+>{\tab{text on first slide\\foo}} \uncover<+>{text on second slide}% \uncover<+>{text on third slide} \end{frame} \end{document}</pre> How can I format code here?? – user2478 Dec 22 '10 at 13:12
  • @Herbert: I believe that the solution I provided is simpler and more readable. Disclosure: I didn't try out your suggestion. – Dror Dec 22 '10 at 14:13
2

You can use [t] specifier for the frame to be top-aligned, then the height of the contents below the picutre does not matter:

\documentclass{beamer}

\begin{document}

\begin{frame}[t]\frametitle{My Frame}

\begin{center}
 \rule{3cm}{3cm} % substitute for a picture
\end{center}

\begin{itemize}
\only<1>{
\item First point on first slide
\item Second point on first slide
}
\only<2>{
\item Only one point on second slide
}
\end{itemize}

\end{frame}

\end{document}
1

You could also use the overlayarea. Consider the following MWE:

\documentclass{beamer}

\usepackage{tikz}

\begin{document}
\begin{frame}
  \frametitle{TBA}
  \begin{overlayarea}{\textwidth}{2cm}
    \begin{center}
      \begin{tikzpicture}
        \draw (-1,-1) -- (1,1);
      \end{tikzpicture}
    \end{center}
  \end{overlayarea}
  \begin{overlayarea}{\textwidth}{2cm}
    \only<1>{Bla}
    \only<2>{Blo}
  \end{overlayarea}
\end{frame}
\end{document}

Note that this option, namely using overlayarea let the user have a great degree of freedom. For example, in combination with minipage, one can achieve similar effect only with two "vertical columns".

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.