Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I like to have the pictures in the following presentation each on the same position. Unfortunately the position changes after the second slide.

How to keep the (vertical) position? Pictures are all the same size.

\PassOptionsToPackage{demo}{graphics}
 \documentclass{beamer}

\begin{document}

\begin{frame}
    \only<1>{\includegraphics[width=\textwidth]{pic1}}
    \only<2>{\includegraphics[width=\textwidth]{pic2}}
    \only<3>{\includegraphics[width=\textwidth]{pic3}}
    \only<4>{\includegraphics[width=\textwidth]{pic4}}
    \transduration<1-4>{1}
\end{frame}

\end{document}
share|improve this question
    
Try to add [t] to \begin{frame}, the result is then \begin{frame}[t] –  tohecz Nov 5 '12 at 15:50

1 Answer 1

up vote 5 down vote accepted

If you use [t] as the optional argument for frame, the images will be all aligned to the top of the frame. Another option, with alignment not necessarily to the top, would be to use an overprint environment, as the following example illustrates:

\PassOptionsToPackage{demo}{graphics}
 \documentclass{beamer}

\begin{document}

\begin{frame}
\begin{overprint}
    \only<1>{\includegraphics[width=\textwidth]{pic1}}
    \only<2>{\includegraphics[width=\textwidth]{pic2}}
    \only<3>{\includegraphics[width=\textwidth]{pic3}}
    \only<4>{\includegraphics[width=\textwidth]{pic4}}
    \transduration<1-4>{1}
\end{overprint}
\end{frame}

\end{document}
share|improve this answer
    
Thank you @Gonzalo. I had still the same effect in the last slide, when used overprint in my real file. The mistake i made: I had a blank line before \transduration. After deleting this line your code worked well. –  schmendrich Nov 6 '12 at 11:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.