3

This is a "nice to have"-question, I guess:

I'm using the animate package to show a sequence of software dialog screenshots. In getting through the series I added that useful but ugly looking controls panel (yes, I have tried different fg/bg-colors ... it didn't make the thing better). The screenshots are these usual <BACK/NEXT> dialogs.

Is it possible to get the animation command FORWARD/BACKWARD in these NEXT> and <BACK button areas in the screenshots, so that -- similar to the real software -- the reader must click to 'NEXT' in the sceenshot to get the next pic and clicking 'BACK' shows the previous screenshot?

Hope, I could express it understandable ...

0

1 Answer 1

1

This is a nice example of using the JavaScript API of animate and the \mediabutton command of media9.

User Caramdir's excellent onimage package is used to place the buttons onto the animation. However, we have to patch onimage.sty in order to not use \includegraphics.

For the code below to compile, copy the example image files from package mwe into the current directory as

cp $TEXMF/tex/latex/mwe/example-image-a.png ./example-image-1.png
cp $TEXMF/tex/latex/mwe/example-image-b.png ./example-image-2.png
cp $TEXMF/tex/latex/mwe/example-image-c.png ./example-image-3.png

since we need numbered images for \animategraphics.

enter image description here

\documentclass{beamer}

\usepackage{animate}
\usepackage{media9} % buttons via \mediabutton

%get it from http://bazaar.launchpad.net/~tex-sx/tex-sx/development/view/head:/onimage.dtx
\usepackage{onimage}

%patch onimage.sty not to use \includegraphics
\makeatletter
\def\tikzonimage@opt[#1]#2{%
    \begin{tikzpicture}
        %\node[inner sep=0] (image) {\includegraphics[#1]{#2}};
        \node[inner sep=0] (image) {#2};
        \begin{tikzonnode}{image}%
}
\makeatother

\begin{document}
\begin{frame}

  \begin{tikzonimage}{%
    \animategraphics[method=ocg,label=myGUI,step,nomouse,width=0.8\linewidth]{1}{example-image-}{1}{3}
  }[tsx/show help lines]
    \node at (0.8 , 0.8) [anchor=south east, inner sep=0pt, outer sep=0pt] {
      \mediabutton[
        jsaction={try{anim.myGUI.frameNum--}catch(e){}}
      ]{\fbox{\small\strut back}}};
    \node at (0.8 , 0.8) [anchor=south west, inner sep=0pt, outer sep=0pt] {
      \mediabutton[
        jsaction={try{anim.myGUI.frameNum++}catch(e){}}
      ]{\fbox{\small\strut next}}};
  \end{tikzonimage}  

\end{frame}
\end{document}
1
  • Uh ... wow, how cool is that? Exactlely what I was looking for => THANKS!!!
    – tobber
    Jul 30, 2015 at 12:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .