12

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.

Lili
  • 121
  • 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 08: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 08: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 08: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? – samcarter_is_at_topanswers.xyz Jan 17 '17 at 09: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? – samcarter_is_at_topanswers.xyz Jan 17 '17 at 09:31

1 Answers1

18

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)

Henri Menke
  • 109,596