1

I see there are several questions about inserting animations into tex beamers. I have tried several of the suggested methods, but always get the same output: a png per slide instead of one slide with an animation.

\documentclass{beamer}
\usepackage{animate}
\usepackage{xmpmulti}
\usepackage{tikz}
\begin{document}

\begin{frame}{Embedded Animation}
    \transduration<0-8>{0}
    \multiinclude[<+->][format=png, graphics={width=\textwidth}] {pres_plots/images/flumap}
\end{frame}

\begin{frame}
 \begin{center}
  \begin{tikzpicture}
   \foreach \Value in {1,2,3,4,5,6,7,8}
    \node<\Value> (pres_plots/images/flumap-\Value){\includegraphics[width=.5\linewidth]{pres_plots/images/flumap-\Value}};
   \end{tikzpicture}
 \end{center}
\end{frame}

\begin{frame}
 \begin{center}
    \includegraphics<1>[width=.5\linewidth]{pres_plots/images/flumap-0}
    \includegraphics<2>[width=.5\linewidth]{pres_plots/images/flumap-1}
    \includegraphics<3>[width=.5\linewidth]{pres_plots/images/flumap-2}
 \end{center}
\end{frame}

\end{document}

Any suggestions?

  • Your first solution is an animation if you open it in a suitable pdf viewer (e.g. adobe reader) in presentation view. It will automatically play the 8 slides within the frame. – samcarter is at topanswers.xyz Aug 17 '17 at 14:45
  • If you really want to have only a single slide, try the animate package, but it requires a pdf viewer capable of JavaScript – samcarter is at topanswers.xyz Aug 17 '17 at 14:54
  • @samcarter, thanks! Any idea why the others don't work? – ke.re Aug 17 '17 at 14:58
  • The third example can easily be animated using \transduration<0-3>{0}. The second one probably as well, but I did not test this one. – samcarter is at topanswers.xyz Aug 17 '17 at 15:01
  • @samcarter, ah, transduration is needed as well! And the number in the {} sets the speed. Thanks! – ke.re Aug 17 '17 at 15:10
1

The first example you show is a perfectly fine animation. To view it open it in a suitable pdf viewer (e.g. adobe reader) in presentation view. It will automatically play the 8 slides within the frame. The key element to this example is

\transduration<0-8>{0}

which means, that the first 8 slides in this frame will be automatically played for a duration of 0 seconds -- which translates into a finite amount of time the pdf viewer needs to change the slides.

Using this line, you can animate your other two examples in the same way.


If you don't like this multiples slides per frame concept, there is also the animate package which uses JavaScript (check if your pdfviewer has this) to show the animations within a single slide. See https://tex.stackexchange.com/a/117556/36296 for a short example.


Please consider: if the pdf viewer does not support the method you choose (for example if you present from a foreign computer) you can still manually step through the slides in the first case, but with the javascript solution you just won't see anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.