2

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? gut brain axis

gut brain axis 2 gut brain axis 3 gut brain axis 4

brain gut

  • 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
1

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:

enter image description here

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.