# How do I alternate graphics in LaTeX beamer

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?

-

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

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


do

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

-
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}

-