# Not able to include even the simplest animation in my presentation

I'm a little bit lost regarding the inclusion of an animation in my presentation. I have tried to use the animation package, but I am not even close to the desired result.

The animation I would like to have is very simple: a seesaw that is first completely horizontal. Then moves downward (left side of the seesaw higher than the right side). And then horizontal again. These are three moves, which I want to happen when I click my mouse in the presentation.

I made an example of the seesaw in powerpoint, to give a bit of an illustration of the animation (for example, the euro should be higher than the dollar when the seesaw moves). I would like to use this in a formal academic presentation, so any tips regarding the layout are also very welcome!

• What can I further do to get some reactions on this post? As I was not even close to a desirable result, I cannot post a MWE. Other suggestions to get more response? – peter Jan 26 '17 at 16:28
• It is not clear what the actual problem is (using animate, creating the graphics, etc.). I recommend starting to read the TikZ manual. TikZ allows you to create vector graphics inline (i. e. in the source of your document). Animating is the minor problem then. – AlexG Jan 27 '17 at 16:41
• Animations in PDFs depend on the PDF-Viewer. – Schweinebacke Jan 28 '17 at 14:06
• Peter, you have the problem, of creating an animated image with LaTeX means, is that true? – Jan Jan 28 '17 at 18:58
• What have you tried so far? Having a look at the picture itself, it does not look very hard to get the desired output for one frame of the animation if you have a look at the basics of the tikz package. – epR8GaYuh Jan 29 '17 at 9:52

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usepackage{eurosym}

\begin{document}
\begin{frame}
% for animations see beamer documentation page 135f (for version 3.33)
% what I have failed to find in the documentation
% is that the "counter" in \animatevalue may NOT be a LaTeX counter
% but must be TeX count
% regarding the difference see
% https://www.texdev.net/2009/11/17/tex-counts-and-latex-counters/
\newcount\angle
\animate<2-10,12-20>
%\transduration{0}
\newcommand{\maxangle}{-20}
\only<1-10>{\animatevalue<1-10>{\angle}{0}{\maxangle}}
\only<11-21>{\animatevalue<11-20>{\angle}{\maxangle}{0}}
\begin{center}
% https://tex.stackexchange.com/a/18201/120953
\pgfdeclarelayer{bg1}    % declare background layer
\pgfdeclarelayer{bg2}    % declare background layer
\pgfsetlayers{bg2,bg1,main}  % set the order of the layers (main is the standard layer)
\begin{tikzpicture}
\tikzset{%
my border style/.style = {
draw=blue,
line width=2pt,
},
my fill style/.style = {
fill=blue!50,
},
mynodestyle/.style = {
circle,
my border style,
fill,
minimum size=3em,
outer sep=0pt,
transform shape,
},
}
\begin{scope}[rotate=\the\angle]
\node[mynodestyle, fill=blue!30!white] (euro) at (-2, 0) [above] {\%\euro};
\draw (euro.south) -- (dollar.south);
\end{scope}
\draw[] (0,0) -- (1,-1) -- (-1,-1) -- cycle;
\node[mynodestyle, fill=none, draw=none] (euro) at (-2, 0) [above] {};
\node[mynodestyle, fill=none, draw=none] (dollar) at (2, 0) [above] {};
\printBoundingBox
\end{tikzpicture}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\begin{center}
\begin{animateinline}[controls]{12}
\multiframe{21}{iAngle=0+-1}{ % 0, -1, ...,-20
\seesaw{\iAngle}
}
\newframe* %Pause; click to continue
\multiframe{20}{iAngle=-19+1}{ % -19, -18, ..., 0
\seesaw{\iAngle}
}
\end{animateinline}
\end{center}
\end{frame}

\end{document}


• This is indeed what I intended! I gues the separate pages will at some point turn into one animation? I would really appreciate it if you could make this even nicer :) I will take a more detailed look at your code tomorrow, as I of course want to learn to make these things myself. – peter Jan 30 '17 at 23:30
• The separate pages are the way beamer does animations. It plays them automatically with a given speed but this also depends on the pdf viewer. The beamer documentation gives you more explanation. – JLo0815 Jan 31 '17 at 8:11
• The bounding box changes between animation frames. I took the liberty to add a macro that prints the current BBox coordinates to the terminal. These can be used to set the same BBox for all frames ( \useasboundingbox (...,...) rectangle (...,...);. Moreover I added a version that makes use of the animate package. After all, it is you, @jakun, who deserves the bounty. – AlexG Jan 31 '17 at 10:30
• @AlexG thanks. I have just installed Foxit Reader Version 2.3.0 but I can not find the button to enter fullscreen mode... I have tried F5 (which does the trick in evince) and F11 (which I have read online for Foxit) but nothing happened. – jakun Jan 31 '17 at 16:45
• @AlexG I have figured out why the size of the TikZ picture was changing in my first attempt: I tried to draw the see-saw always additionall invisibly at the extreme positions. But with \draw=none the border was not drawn and thus .5\pgflinewidth were missing. I like your idea of saving the bounding box (although I am a little surprised it looks so complicated) but I think it's good to show several different options. Therefore I am using my first approach again in my example and have moved your macro to your example. – jakun Jan 31 '17 at 19:30