[Tex/LaTex] Animating Protocols

animationsbeamer

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?

Best Answer

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};
\node (r) at (5,0) {receiver};
\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.