5

In Beamer, I would like to post a figure, then add some text using \itemize, and change the figure inbetween items without moving the already posted text. Here is roughly what I want:

All on the same slide:

\documentclass{beamer}
\usepackage{graphicx}

\begin{document}

\begin{frame}
\includegraphics[width=\textwidth]{test1}
\pause
\begin{itemize}
\item
Text 1 Text 1 Text 1 Text 1 Text 1 Text 1 Text 1 Text 1 Text 1
\pause
%%Change the original figure to "test2" without moving any already written text.
\pause
\item
Text 2 Text 2 Text 2 Text 2 Text 2 Text 2 Text 2 Text 2 Text 2 Text 2
\pause
%%Change figure again to "test3" again without moving any text.
\end{itemize}
\end{frame}

\end{document}
2
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. And a tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it).
    – user31729
    May 30 '14 at 18:18
  • @Christian Thanks, I did not know how to make the code box. May 30 '14 at 18:22
6

I think, you meant something like this -- if the image should be 'overlayed' (ideally with an other image of same dimensions), it is appropiate to use the \only<firstframe-endframe> command, e.g. \only<1-2>.... showing only on frame 1 to 2.

Use the same command for text lines too, but be aware about the textheight of them!

\documentclass[demo]{beamer}
\usepackage{graphicx}

\begin{document}

\begin{frame}%
\only<1-2>{\includegraphics[width=0.3\textwidth]{image1}%
}%
\only<3-4>{\includegraphics[width=0.3\textwidth]{image2}%
}%
\only<5-5>{\includegraphics[width=0.3\textwidth]{image3}%
}%
\begin{itemize}
\item<1-5>And now I show you the \textcolor{brown}{1st} image%
\item<3-5>And now I show you the \textcolor{blue}{2nd} image%
\item<5-5>And now I show you the \textcolor{red}{3rd} image%
\end{itemize}
%
\end{frame}

\end{document}

Note Remove the demo option from \documentclass specification.

enter image description here

5
  • The problem with this is that the new text replaces the old text. What I would like is a solution that keeps the earlier text, and especially without moving the old text either. May 30 '14 at 19:19
  • @Trevor: Ok, that is much easier! I will update
    – user31729
    May 30 '14 at 19:22
  • @Trevor: The synchronizing between text and images depends on your choice, so I can only guess whether you want to show picture, wait, show text etc?
    – user31729
    May 30 '14 at 19:26
  • Thank you so much, I did not really understand until now what the \only command was doing. May 30 '14 at 19:32
  • @Trevor: Synchronizing can in most cases be done with \only, sometimes in conjunction with \onslide, but both methods require careful usage. (and a lot of recompilations ;-))
    – user31729
    May 30 '14 at 19:49

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.