1

I wish to include an .gif animation in my latex beamer presentation. Based on my reading from various sources, including this website, what I understood was that I need to convert .gif into a series of .jpg images. I have converted .gif into 10 .jpg images titled from foo-1.jpg to foo-10.jpg. I have put all these images in the same folder where I have my template file and other images which are used subsequently. Next, I am using the below commands to include it as an animation

\begin{frame}    
\animategraphics{12}{foo-}{0}{10}
\end{frame}

On doing this, I get no error, but the slide is shown as given in the attached image. enter image description here

As it can be clearly seen, the animation does not fit on the slide, nor is it showing a set of moving images like a .gif file. What shall I do to get the animation nicely on the slide. I am ready to share all the 10 images if needed as a MWE, but please help me to overcome this problem.

15
  • 4
    \animategraphics[loop,controls,width=\linewidth]{12}{foo-}{0}{10} or whatever width you want Commented May 2, 2018 at 15:06
  • 3
    to view it, you need a pdf viewer with of java script Commented May 2, 2018 at 15:07
  • 2
    or use tex.stackexchange.com/a/240247/36296 which I personally find safer Commented May 2, 2018 at 15:07
  • 1
    Also off-topic, but your figure seems to be simple enough that it could be drawn with TikZ/pgfplots or pstricks.
    – user121799
    Commented May 2, 2018 at 15:16
  • 2
    Yes, but such things can be drawn in TikZ/pgfplots/pstricks. I am doing this all time. You just need to animate a parameter.
    – user121799
    Commented May 2, 2018 at 15:47

1 Answer 1

2

The answer to the problem has been borrowed from the comment of @samcarter. The correct latex code used is as follows

\begin{frame}[t]
\animategraphics[loop,controls,width=8.5cm]{12}{foo-}{0}{20}
\end{frame}

Using the above code, the screenshot of the solution slide is given as follows: enter image description here

As it can be seen, it is possible to play, pause and some other options are also there, which makes it look better in a presentation

3
  • 2
    It would look even better if you used a LaTeX-based plotting/graphing package such as pgfplots together with animate. As @marmot suggests, you will get high quality vector graphics which can be animated by animating a parameter.
    – AlexG
    Commented May 2, 2018 at 20:03
  • @AlexG I don't know aboutpgfplotspackage. If possible, please post an answer on how it can be done
    – ShJ
    Commented May 3, 2018 at 1:19
  • 1
    Look for tagged questions, entering [animate] [pgfplots] in the search bar.
    – AlexG
    Commented May 3, 2018 at 4:53

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