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'm trying to alternate graphics on a slide:

\frame{
\frametitle{Verkette Liste Beispiel} 
\begin{figure}
    \includegraphics<1>[scale=0.7]{pics/List-0.pdf}
    \includegraphics<2>[scale=0.7]{pics/List-1.pdf}
    \caption<1>{Hallo}
    \caption<2>{Welt}
\end{figure}
}

My problem is I don't get alternating captions. I get something like this: http://public.kungi.org/main-faulty.pdf

I tried the solution from this question: http://stackoverflow.com/questions/1088761/how-to-change-an-image-on-a-slide-in-latex but it did not work for me.

What am I doing wrong?

share|improve this question
add comment

2 Answers

up vote 13 down vote accepted

The \caption command is not "overlay specification aware". Instead of

\caption<1>{Hallo}
\caption<2>{Welt}

do

\caption{\only<1>{Hallo}\only<2>{Welt}}
share|improve this answer
    
Works like a charm. Thank you. –  Kungi Feb 8 '11 at 15:04
    
It works fine but the numbers in captions are the same. Is there a solution for that? –  user19238 Sep 27 '12 at 6:39
add comment

use it this way:

\documentclass{beamer}
\begin{document}

\begin{frame}{Verkette Liste Beispiel}{}
\begin{figure}
    \includegraphics<1>[scale=0.7]{pics/List-0.pdf}
    \includegraphics<2>[scale=0.7]{pics/List-1.pdf}
    \caption{\only<1>{Hallo}\only<2>{Welt}}
\end{figure}
\end{frame}

\end{document}
share|improve this answer
add comment

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.