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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 14 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

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

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.