I need to put an animation into a slideshow I am making using the beamer package for LaTex. Ideally I would like it to loop and play again and again like a GIF, but anything similar would work as well. I used MatLab to generate the figures (right now I just have a sequence of pictures, but I should be able to put it into any format necessary). I know there is an animator function in beamer, but I've no idea how to really use it. I've also seen some places that using PNG files can accomplish the same result as GIF's, but once again I'm not sure how to do this.

I found a similar question on this site, but they seem to have LaTex generating the figures??? Besides when I copied the code into my editor it didn't run. I really like the format of the animation in this example, but no idea how to adapt it to work for me. Here is the link to the page: Similar Question with Answer.

Any advice would be greatly appreciated.


Use the animate package. Its \animategraphics command will take your external images and put them in an animation. So, assuming that you have images image1.jpg, ... image6.jpg (or in any other format recognized by LaTeX), write:


(Btw, this works also in a "normal" document, i.e. in a non-beamer class.)

  • Thanks so much it works great. Quick question, is there a way to get the controls like the one in the example and/or tell it how many frames (pictures) to do per second. I know I'm being picky now, but I thought I'd ask. – Logan Feb 22 '13 at 2:30
  • 1
    This currently isn't working for me. Is this feature widely implemented by PDF readers, or could that be my problem? – MaxAxeHax Jun 9 '13 at 18:34
  • 1
    @SašoŽivanović, what about only one gif image? How to include it and animate it? – Sigur Jun 3 '14 at 0:16
  • 1
    @SašoŽivanović, I mean: how to include a gif file so that when I show the frame containing it the gif starts to animate (as it does when we open it with the browser, for example). But I guess that gif is not supported. – Sigur Jun 4 '14 at 17:03
  • 1
    @Sigur You can use Imagemagick to convert the GIF to a series of PNG frames, and use this method to play back the series of image files. – Vortico Jul 17 '14 at 23:40

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.