[Tex/LaTex] Beamer overlay images in column environment

beameroverlays

I have a frame with the two columns, one for an image, and one for itemized text. For example,

\frame{\frametitle{hello} 

\begin{columns}[onlytextwidth]
    \begin{column}{0.4\textwidth}
      \centering
      \includegraphics[width=40mm]{pic1.png}
    \end{column}

    \begin{column}{0.6\textwidth}
    \begin{itemize}
      \item statement 1
      \item statement 2
    \end{itemize}
    \end{itemize}
    \end{column}
​  \end{columns}


}

I want to specify an overlay, such that pic1 appears along with statement 1 and pic2 appears with statement 2. How do could I do this?

Best Answer

Using the fact that both \includegraphics and \item are overlay-aware, you can do somthing like this:

\documentclass{beamer}

\begin{document}

\frame{\frametitle{hello} 
\begin{columns}[onlytextwidth]
    \begin{column}{0.4\textwidth}
      \centering
      \includegraphics<1>[width=40mm]{cat}
      \includegraphics<2>[width=40mm]{ctanlion}
    \end{column}

    \begin{column}{0.6\textwidth}
    \begin{itemize}
      \item<1> statement 1
      \item<2> statement 2
    \end{itemize}
    \end{column}
​  \end{columns}
}
\end{document}

enter image description here

CTAN lion drawing by Duane Bibby.