# Animating Protocols

I'm creating a beamer presentation on network protocols. I like to put very simple animations in the slides, like an arrow extending from sender to receiver, showing the flow of network messages.

I saw LaTeX packages like animate which can do this. Yet I believe they are an overkill.

Or, don't they? Well, I don't know.

Is there a simple way for doing what I'm after?

-

beamer has an \animate method that advances slides automatically in succession. You just have to create the "stop motion" slides. For instance:

\documentclass{beamer}
\usepackage{tikz}

\begin{document}

\begin{frame}
\begin{tikzpicture}[every node/.style={draw}]
\node (s) {sender};
\animate<2-10>
\foreach \pos in {0.1,0.2,...,1.0} {
\action<+>{
\path (s) -- (r) node[pos=\pos,coordinate] (p) {};
\draw[->] (s) -- (p);
}
}
\end{tikzpicture}
\end{frame}

\end{document}


Open the PDF in Adobe Reader and enable full screen mode. After one click you will see the arrow extend animatedly from sender to receiver.

-
Thanks Matthew. Exactly what I needed! –  Sadeq Dousti Dec 1 '10 at 15:07

Using the animate' LaTeX package for this purpose isn't overkill, I think:

\documentclass{beamer}
\usepackage{tikz}
\usepackage{animate}

\begin{document}

\begin{frame}
\begin{animateinline}[loop]{10}
\multiframe{10}{rPos=0.1+0.1}{
\begin{tikzpicture}[every node/.style={draw}]
\node (s) {sender};
\path (s) -- (r) node[pos=\rPos,coordinate] (p) {};
\draw[->] (s) -- (p);
\end{tikzpicture}
}
\end{animateinline}
\end{frame}

\end{document}
`

The number of code lines is about the same as in Matthews example. And the animation can be configured to loop over the frames.

-
+1. Thanks a lot Alexander. As you said, it wasn't an overkill at all! –  Sadeq Dousti Dec 2 '10 at 11:04