21

I would that the images would appeared for each overlay. Eg, in overlay 1 I have img1.pdf, in overlay 2 I have img2.pdf, and in overlay 3 I have img3.pdf. How I do this?

\begin{center}
  \begin{tikzpicture}
    \node (img1) {\includegraphics[width=.5\linewidth]{img1.pdf}};
    \pause
    \node (img2) {\includegraphics[width=.5\linewidth]{img2.pdf}};
    \pause
    \node (img3) {\includegraphics[width=.5\linewidth]{img3.pdf}};
  \end{tikzpicture}
\end{center}
2
  • Do yo want to get those three images in the same slide or in different but subsequent slides? I have not clear the question, could you explain yourself better and add a complete MWE for your question?
    – Aradnix
    Commented Nov 9, 2015 at 16:03
  • 1
    I made an edit to this question, hope it's appropriate, feel free to roll back if not
    – cmhughes
    Commented Nov 9, 2015 at 18:18

2 Answers 2

21

\node (as well as all TikZ paths) is overlay-aware so you can use

\node<overlay spec.> [options] {contents};

A complete example:

\documentclass{beamer}
\usepackage{tikz}

\begin{document}

\begin{frame}
\begin{center}
  \begin{tikzpicture}
    \node<1> (img1) {\includegraphics[width=.5\linewidth]{example-image-a}};
    \node<2> (img2) {\includegraphics[width=.5\linewidth]{example-image-b}};
    \node<3> (img3) {\includegraphics[width=.5\linewidth]{example-image-c}};
  \end{tikzpicture}
\end{center}
\end{frame}

\end{document}

An animation of the result:

enter image description here

With your numbering schema you can use a loop:

\documentclass{beamer}
\usepackage{tikz}

\begin{document}

\begin{frame}
\begin{center}
  \begin{tikzpicture}
    \foreach \Value in {1,2,3}
      \node<\Value> (img\Value) {\includegraphics[width=.5\linewidth]{img\Value}};
  \end{tikzpicture}
\end{center}
\end{frame}

\end{document}
2
20

I like using tikz too, but in this particular case it may not be necessary :)

% arara: pdflatex
% !arara: indent: {overwrite: on}
\documentclass{beamer}

\begin{document}

\begin{frame}
    \begin{center}
        \includegraphics<1>[width=.5\linewidth]{example-image-a}
        \includegraphics<2>[width=.5\linewidth]{example-image-b}
        \includegraphics<3>[width=.5\linewidth]{example-image-c}
    \end{center}
\end{frame}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .