# positioning and showing relationship between two images with arrows and animating the arrows

a. Though I can include these slides as images, are there any better ways to include these in beamer? b . Can I animate the arrows and text ? Edit: I would like to use two images 1.brain 2. Gut and place arrows and text in between and animate them if possible. Is this achievable with a simpler code?

• Sure, you can use overlay specifications, for example. Or use the animate package; it depends on what exactly you are trying to achieve. – Gonzalo Medina Aug 8 '13 at 20:00
• thanks francis and gonzalo . But this won't give me a smooth animation. I would rather like to use two images 1.brain 2. Gut and place arrows and text in between and animate them if possible. Is this achievable with a simpler code? – Vaibhav Aug 9 '13 at 2:54

What you asked (if I understand it correctly) can be achieved by combining animate and tikz packages. Though it can hardly be called "simpler code". Now here is a demonstration, it is incomplete with only four frames, such that it roughly covers the first two images you posted; in addition, since I don't have the original image of brain and stomach, I didn't include them, however you can put them in designated position with \includegraphics commands:

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

\usetikzlibrary{arrows,decorations.markings}
\tikzstyle{myarrow} = [->,ultra thick,>=latex']

\begin{document}

\begin{frame}{Brain and Stomach}

\begin{center}
\begin{animateinline}[controls]{1}

\begin{tikzpicture}
\path[use as bounding box] (-4.5,-3.5) rectangle (4.5,3.5);
\draw[myarrow,black] (-1.97,-1.52) -- (-1.97,1.48);
\draw[myarrow,yellow] (-2,-1.5) node[anchor=north,text width=2.5cm]
{
\begin{itemize}
\item Increased visceral perception
\end{itemize}
}
-- (-2,1.5);
\end{tikzpicture}

\newframe

\begin{tikzpicture}
\path[use as bounding box] (-4.5,-3.5) rectangle (4.5,3.5);
\draw[myarrow,black] (-1.97,-1.52) -- (-1.97,1.48);
\draw[myarrow,yellow] (-2,-1.5) node[anchor=north,text width=2.5cm]
{
\begin{itemize}
\item Increased visceral perception
\end{itemize}
}
-- (-2,1.5);
\draw[myarrow,black] (1.97,1.48) -- (1.97,-1.52);
\draw[myarrow,yellow] (2,1.5)  --(2,-1.5)node[anchor=north,text width=2.5cm]
{
\begin{itemize}
\item Altered motility
\end{itemize}
};
\end{tikzpicture}

\newframe

\begin{tikzpicture}
\path[use as bounding box] (-4.5,-3.5) rectangle (4.5,3.5);
\draw[myarrow,black] (-1.97,-1.52) -- (-1.97,1.48);
\draw[myarrow,yellow] (-2,-1.5) node[anchor=north,text width=2.5cm]
{
\begin{itemize}
\item Increased sensory input
\end{itemize}
}
-- (-2,1.5);
\end{tikzpicture}

\newframe

\begin{tikzpicture}
\path[use as bounding box] (-4.5,-3.5) rectangle (4.5,3.5);
\draw[myarrow,black] (-1.97,-1.52) -- (-1.97,1.48);
\draw[myarrow,yellow] (-2,-1.5) node[anchor=north,text width=2.5cm]
{
\begin{itemize}
\item Increased sensory input
\end{itemize}
}
-- (-2,1.5);
\draw[myarrow,black] (1.97,1.48) -- (1.97,-1.52);
\draw[myarrow,yellow] (2,1.5)node[anchor=south,text width=3cm]
{
\begin{itemize}
\item Reduced descending inhibition
\end{itemize}
}
-- (2,-1.5);
\end{tikzpicture}
\end{animateinline}
\end{center}

\end{frame}

\end{document}


Inasmuch as the output is animated, it is hard for me to show it here. So compile the code and see if you get the desired result.

Here is one of the frames:

• Mostly a foolish question, but how did you decide the position on paper ? by visual impression ?\draw[myarrow,black] (1.97,1.48) -- (1.97,-1.52); – Vaibhav Aug 9 '13 at 9:17
• @user34083: indeed I tweaked the position manually, though you can use copy shadow from the tikz library called shadows, check out section 47 of PGF manual (v2.10) for more info. – Francis Aug 9 '13 at 9:45