7

I am new to LaTeX. I am trying to put a GIF into my LaTeX presentation. I followed @samcarter guide here.

I have 23 pictures so I changed something and tried this:

\transduration<0-23>{0}
        \multiinclude[<+->][format=png, graphics={width=\textwidth}]{something}

But I always get this warning:

LaTeX Warning: File `something-0.png' not found on input line 132 /LaTeX_Vorlage_Presentations/.example.tex. swp:132: Unable to load picture or PDF file 'something-0.png'.

The something.pngs are in the same file folder as the LaTeX stuff too.

  • Welcome to TeX.SE. Please, always include a complete MWE (Minimal Working Example) from \documentclass till \end{document}. It'll help us much to help you. In your special case: your title and text talks about GIF images, while the code example says format=png. So I am wondering, which is correct. – Jan Jan 17 '17 at 8:31
  • @Jan if you follow the guide he linked it seems like he converted the .gif in .png images of the single frames. – idkfa Jan 17 '17 at 8:33
  • @idkfa: Sorry, I was editing the question and was wondering about the confusion. I did not following the link while editing. – Jan Jan 17 '17 at 8:39
  • Two questions: 1) can you check that the converted images start with something-0.png and not, say something-1.png ? 2) are you compiling with pdflatex? or latex or something else? – user36296 Jan 17 '17 at 9:29
  • 1
    And another: some operating systems are picky with capitalization. Are your images of type png or PNG? Can you check with an ls in the folder of the images? – user36296 Jan 17 '17 at 9:31
10

Here is the procedure on GNU/Linux. I took the gif image from this answer of mine.

enter image description here

First you need to burst the gif into single frames. I use the ImageMagick tool convert for this.

mkdir gif
convert -coalesce animation.gif gif/frame-%d.png

This will create the files frame-0.png through frame-36.png in the subdirectory gif/. To include this in a beamer presentation I use the animate package. It offers the command \animategraphics to conatenate single images to an animation. The syntax is

\animategraphics[<options>]{<frame rate>}{<path prefix>}{<start frame>}{<end frame>}

In our case, the path prefix is gif/frame-. The start frame is 0, the last frame is 36. A frame rate of 12 is empirically chosen, since it looks best. The image is too large for the slide, so we scale it down using width=\textwidth. Here is the full example.

\documentclass{beamer}
\usepackage{animate}
\begin{document}
\begin{frame}
  \animategraphics[width=\textwidth]{12}{gif/frame-}{0}{36}
\end{frame}
\end{document}

N.B.: This is known to work with Adobe Reader, PDF-XChange, and Foxit. (Thanks @AlexG)

  • 1
    PDF-XChange and Foxit should work too. – AlexG Jan 17 '17 at 8:37
  • The loop and autoplay options could be added to produce the animated-gif-feel. – AlexG Jan 17 '17 at 8:39
  • 1
    Some gifs are size-optimized (containing differential frames). To have complete single frames after bursting, always add -coalesce to the convert commandline, as in the answers to the cited question . – AlexG Jan 17 '17 at 8:56
  • 1
    I tried it this way & it worked - thank you so much! You guys saved my presentation – Lili Jan 17 '17 at 10:35

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.