J...S
I'm new here and most my questions had been about beamer.
When overlays are invovled, it is helpful to post an animated gif
image to show how the overlays get uncovered over the slides.
What would be a good way to generate such animated images?
I tried to convert all the slides to images and then used `convert` to
stitch them together into a gif with a set delay.
Could there be better ways?
In my case, the OS is linux if that matters.
Top Answer
samcarter
You could use image magick to directly convert the pdf to .gif
Take for example this animation:
```
\documentclass{beamer}
\usepackage{tikz}
\setbeamertemplate{navigation symbols}{}
\usetikzlibrary{overlay-beamer-styles}
\usepackage{tikzlings}
\begin{document}
\begin{frame}[label=jump]
\begin{tikzpicture}[remember picture, overlay]
\foreach \x in {0,5,...,1105}{
\only<+>{
\begin{scope}[yshift=sin(\x)*1cm,xshift=\thepage/222*18cm]
\marmot[xshift=-1.2cm,yshift=-2.8cm]
\end{scope}
\draw[thick]
(-3.7+\thepage/222*18, 0.6) .. controls
(-3.7+\thepage/222*18, 0.6) and
(-3.5+\thepage/222*18, -0.5) ..
(-1.5+\thepage/222*18, {sin(\x)-2});
}
}
\shade[ball color=red] (-3.7+\thepage/222*18,1.4) ellipse (0.5 and 0.9);
\end{tikzpicture}
\end{frame}
\end{document}
```
Then convert it to gif with
```
magick -density 100 -delay 1 -loop 0 document.pdf test.gif
```

- for animations in answers, I usually use a `-delay 60` to give the readers a bit of time to see the overlay, but not so much that they get inpatient waiting for the next slide.
- with `-density` you could adjust the quality, however the file size might get very big if the density is too high.