I am working on a document where I want to embed animations using the animate
package. A minimal compilable example of such would be the following:
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.6}
\usepackage{tikz}
\usepackage{media9}
\usepackage{animate}
\usepackage{amsmath}
\begin{document}
\newenvironment{tikzframe}[2]{
\begin{tikzpicture}
\draw[very thin, color=white] (0,0) rectangle (#1,#2);
}
{
\end{tikzpicture}
}
\mediabutton[jsaction={anim['graph_switch'].frameNum=0;}]{
\fbox{$\text{sin}(x)$}
}
\mediabutton[jsaction={anim['graph_switch'].frameNum=1;}]{
\fbox{$\text{sin}(2x)$}
}
\mediabutton[jsaction={anim['graph_switch'].frameNum=2;}]{
\fbox{$\text{sin}(3x)$}
}
\begin{animateinline}[label=graph_switch,width=8cm,height=5cm,step]
\newframe{
\begin{tikzframe}{8}{5}
\begin{axis}[
xlabel={$x$},
ylabel={$\text{sin}(x)$},
xmin=-pi,xmax=pi,
]
\addplot[black,samples=101] {sin(x*180./pi)};
\end{axis}
\end{tikzframe}
}
\newframe{
\begin{tikzframe}{8}{5}
\begin{axis}[
xlabel={$x$},
ylabel={$\text{sin}(2x)$},
xmin=-pi,xmax=pi,
]
\addplot[black,samples=101] {sin(2.*x*180./pi)};
\end{axis}
\end{tikzframe}
}
\newframe{
\begin{tikzframe}{8}{5}
\begin{axis}[
xlabel={$x$},
ylabel={$\text{sin}(3x)$},
xmin=-pi,xmax=pi,
]
\addplot[black,samples=101] {sin(3.*x*180./pi)};
\end{axis}
\end{tikzframe}
}
\end{animateinline}
\end{document}
The example above consists of three buttons and a graph. The buttons allow to switch between plots of sin(x) with different frequencies:
The image above is what this looks like with Adobe Acrobat (acroread), but it doesn't show at all on either Okular or Evince (I haven't tried anything else), which just show a white page.
I know that the animation itself doesn't show on these viewers and I am not intending to get this fixed. What I would like to know instead is how to set a "default" static graph, for instance sin(2x) in the present example, such that at least this shows in viewers other than acroread. Is this possible?