summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/animate/animate.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/animate/animate.tex')
-rw-r--r--Master/texmf-dist/doc/latex/animate/animate.tex434
1 files changed, 408 insertions, 26 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/animate.tex b/Master/texmf-dist/doc/latex/animate/animate.tex
index ee6f6f26cdc..2524f23775e 100644
--- a/Master/texmf-dist/doc/latex/animate/animate.tex
+++ b/Master/texmf-dist/doc/latex/animate/animate.tex
@@ -8,10 +8,13 @@
\frenchspacing
\usepackage[UKenglish]{babel}
\usepackage{pst-3dplot}
+\usepackage{pst-node,pst-plot,pst-tools,pst-text}
\usepackage{animate}
+\usepackage{media9}
\usepackage{intcalc}
\usepackage{graphicx}
\graphicspath{{files/}}
+\addmediapath{files}
\usepackage{color}
\usepackage{textcomp}
\usepackage{lmodern}
@@ -22,8 +25,10 @@
\usepackage{parskip}
\usepackage{tabls}
\usepackage{multirow}
-\usepackage{hyperref}
+\usepackage[bookmarksnumbered,linktocpage]{hyperref}
+\usepackage{breakurl}
\usepackage{amsmath}
+\usepackage{fancyvrb}
\usepackage[all]{hypcap}
\clubpenalty=10000
\widowpenalty=10000
@@ -48,7 +53,6 @@
\def\keywords{include portable PDF animation animated PDF animating embed animated graphics LaTeX pdfLaTeX PSTricks pgf TikZ LaTeX-picture MetaPost inline graphics vector graphics animated GIF LaTeX dvips ps2pdf dvipdfmx XeLaTeX JavaScript Adobe Reader}
\hypersetup{
- bookmarksnumbered,linktocpage,breaklinks,
pdftitle={The animate Package},
pdfsubject={Documentation},
pdfauthor={Alexander Grahn},
@@ -83,7 +87,7 @@
%\newpage
\section{Introduction}
-This package provides an interface to create PDFs with animated content from sets of graphics or image files, from inline graphics, such as \LaTeX-picture, PSTricks or pgf/TikZ generated pictures, or just from typeset text. Unlike standard movie/video formats, which can be embedded, for example, using the \LaTeX{} package `movie15'~\cite{movie15}, package `animate' allows for animating vector graphics. The result is roughly similar to the SWF (Flash) format, although not as space-efficient.
+This package provides an interface to create PDFs with animated content from sets of graphics or image files, from inline graphics, such as \LaTeX-picture, PSTricks or pgf/TikZ generated pictures, or just from typeset text. Unlike standard movie/video formats, package `animate' allows for animating vector graphics. The result is roughly similar to the SWF (Flash) format, although not as space-efficient.
Package `animate' supports the usual PDF making workflows, i.\,e. pdf\LaTeX{}, \LaTeX{} $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+/Distiller and \pXepLaTeX{} $\rightarrow$ \verb+(x)dvipdfmx+.
@@ -306,14 +310,16 @@ If a timeline is associated with the animation, the graphics files or inline gra
A timeline-based animation can be thought of as a \emph{living stack} of translucent transparencies. Each animation frame is a snapshot of the stack viewed \emph{from above}. Transparencies are usually put on top of that stack and stay there for a given number of frames before expiring (becoming invisible). The lifetime of each transparency within the stack can be set individually. Once expired, a transparency can be put on the stack again, if desired. The stack may also be divided into an arbitrary number of \emph{sub-stacks} to facilitate the creation of layers, such as background, foreground and intermediate layers. Sub-stacks allow the insertion of transparencies at depth positions of the global stack other than just the top. It is important to keep the stack-like nature of animations in mind because graphical objects on transparencies at higher stack positions overlay the content of transparencies at lower stack positions.
\myparagraph*{General structure of the timeline file}
-Each line of the timeline file that is not blank and which does not begin with a comment (`\verb+%+') corresponds to \emph{one} frame of the animation. There may be more transparencies than animation frames and vice-versa. A frame specification consists of three, colon-(\verb+:+)-separated fields:
+Each line of the timeline file that is not blank and which does not begin with a comment (`\verb+%+') corresponds to \emph{one} frame of the animation. There may be more transparencies than animation frames and vice-versa. A frame specification consists of three or four colon-(\verb+:+)-separated fields:
\begin{verbatim}
- [*]:[<frame rate>]:[<transparencies>]
+ [*]:[<frame rate>]:[<transparencies>][:<JavaScript>]
\end{verbatim}
-While any field may be left blank, the colons are mandatory.
+While any field may be left blank, the first two colons are mandatory.
An asterisk (`\verb+*+') in the leftmost field causes the animation to pause at that frame, very much as a \verb+\newframe*+ would do; a number in the second field changes the frame rate of the animation section that follows. In connection with the `\verb+timeline+' option, the asterisk extension and the optional \verb+<frame rate>+ argument of \verb+\newframe+ cease to make sense and will be tacitly ignored if present.
+The optional fourth field takes JavaScript code to be executed at that frame. This could could be used, for instance, to play a sound that was embedded using the media9 \LaTeX{} package \cite{media9}. The backslash `\verb+\+' and percent `\verb+%+' characters retain their special meaning from \LaTeX{} and must be escaped by a backslash `\verb+\+' in the JavaScript code. The same applies to unbalanced braces `\verb+{+' and `\verb+}+'. Thus, a code line such as `\verb+console.println('{}%}{\n');+' would have to look like `\verb+console.println('{}\%\}\{\\n');+' in the timeline file. The first pair of braces are balancing themselves and do not need be escaped.
+
The third field \verb+<transparencies>+ is a comma-separated \emph{list} of \emph{transparency specifications} that determines the transparencies to be put on the stack. Semicolons (\verb+;+) are used to separate sub-stacks (= layers) from each other. A \emph{single} transparency specification obeys the syntax
\begin{verbatim}
<transparency ID>[x<number of frames>]
@@ -350,7 +356,7 @@ Due to the stack-like nature of the animation, the position of a transparency sp
The layer concept is best illustrated by an example. In the timeline of Table~\ref{tab:multi}, transparencies are grouped into two sub-stacks only. One is reserved for the background images, transparencies No. 0 \& 1, to be exchanged in frame No. 3, as well as for two other transparencies, No. 7 \& 8, to be interspersed in frame No. 1. A second sub-stack takes the foreground objects that are successively added to the scene. The dotted lines in the third column of the table just mark the border between the two sub-stacks. In frame No. 3, `\verb+c+' first clears the bottom sub-stack before the new background image is inserted. (Instead, `\verb+x3+' could have been used with transparency No. 0 in frame No. 0.) As can be seen in the specifications of frames No. 2 \& 4, sub-stacks need not be explicitly populated; the leading semicolons just ensure the proper assignment of transparencies to animation sub-stacks.
-\begin{table}[ht]\centering
+\begin{table}[hb]\centering
\caption{Timeline example with two sub-stacks}\label{tab:multi}
\begin{tabular}[t]{c|l|c}\hline
frame No. & timeline file & transparency stack\\\hline\hline
@@ -409,6 +415,18 @@ The first example, Fig.~\ref{fig:taylor}, originally written by Jan Hole\v{c}ek~
\usepackage{animate}
\usepackage{graphicx}
+\begin{filecontents}{timeline.txt}
+::0x0 % coordinate system & y=e^x, repeated until last frame
+::1 % one blue curve per frame
+::2
+::3
+::4
+::5
+::6
+::7
+::8
+\end{filecontents}
+
\begin{document}
\begin{center}
@@ -421,23 +439,19 @@ The first example, Fig.~\ref{fig:taylor}, originally written by Jan Hole\v{c}ek~
\end{document}
\end{verbatim}
\normalsize
-Contents of file `timeline.txt':
-\small
-\begin{verbatim}
- ::0x0 % coordinate system & y=e^x, repeated until last frame
- ::1 % one blue curve per frame
- ::2
- ::3
- ::4
- ::5
- ::6
- ::7
- ::8
-\end{verbatim}
-\normalsize
-
\begin{figure}\capstart
\centering
+\begin{VerbatimOut}{timeline.txt}
+::0x0 % coordinate system & y=e^x, repeated until last frame
+::1 % one blue curve per frame
+::2
+::3
+::4
+::5
+::6
+::7
+::8
+\end{VerbatimOut}
\animategraphics[controls,loop,timeline=timeline.txt]{4}{exp_}{0}{8}
\caption{}\label{fig:taylor}
\end{figure}
@@ -889,6 +903,373 @@ A timeline file, written on-the-fly, is used to assemble the curve segments fram
\end{verbatim}
\normalsize
+The last inline example in Fig.~\ref{fig:metronome} is a ticking metronome written by Manuel Luque~\cite{luque12}. The short clicking sound was embedded by means of the media9 package. Whenever the pendulum reaches one of its reversal points, playback of the sound file is started using JavaScript. The JavaScript code was inserted at the corresponding frame specifications in a timeline file. Since the PSTricks macros for drawing the metronome body and the pendulum are quite long they have been moved into an external file, \verb+files/pstmetronome.tex+. Note that the sound can be heard only on Win and Mac platforms. Even then, mileage may vary. A dual core CPU may be necessary for fluent playback.
+\begin{figure}[hb]
+\centering
+\begin{VerbatimOut}{files/pstmetronome.tex}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% animated metronome
+% this code is based to 99.9 percent on the work by Manuel Luque
+% (pstricks.blogspot.com)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\makeatletter
+\pst@addfams{pst-metronome}
+\define@key[psset]{pst-metronome}{theta0}{\def\psk@oscmetronomethetai{#1 }}
+\psset[pst-metronome]{theta0=45} % position initiale du metronome
+\define@key[psset]{pst-metronome}{M}{\def\psk@oscmetronometM{#1 }}
+\psset[pst-metronome]{M=25} % masse du disque en g
+\define@key[psset]{pst-metronome}{m}{\def\psk@oscmetronometm{#1 }}
+\psset[pst-metronome]{m=6} % masse du curseur en g
+\define@key[psset]{pst-metronome}{r}{\def\psk@oscmetronomer{#1 }}
+\psset[pst-metronome]{r=1} % rayon du disque en cm
+\define@key[psset]{pst-metronome}{x}{\def\psk@oscmetronomex{#1 }}
+\psset[pst-metronome]{x=8.4} % position du curseur en cm par rapport à l'axe
+\define@key[psset]{pst-metronome}{d}{\def\psk@oscmetronomed{#1 }}
+\psset[pst-metronome]{d=3.2} % distance de l'axe au centre du disque en cm
+\define@key[psset]{pst-metronome}{dt}{\def\psk@oscmetronomedt{#1 }}
+\psset[pst-metronome]{dt=0.01} % pas pour RK4
+\define@key[psset]{pst-metronome}{nT}{\def\psk@oscmetronomenT{#1 }}
+\psset[pst-metronome]{nT=1} % nombre de périodes représentées
+%---- calculer theta(t) et thetapoint(t) --------
+\def\psmetronome{\pst@object{psmetronome}}
+\def\psmetronome@i{%
+\begingroup%
+\use@par%
+ \begin@SpecialObj%
+ \pstVerb{%
+ /deg2rad {180 div 3.14159 mul} def
+ /rad2deg {180 mul 3.14159 div} def
+ /gp 9.8 def % pesanteur
+ /radius \psk@oscmetronomer 1e-2 mul def % en m
+ /OA \psk@oscmetronomed 1e-2 mul def % distance de l'axe au centre du disque en m
+ /xC \psk@oscmetronomex 1e-2 mul def % position du curseur en m par rapport à l'axe
+ /theta0 \psk@oscmetronomethetai def % en degrés
+ /theta0rad theta0 deg2rad def % en radians
+ /Md \psk@oscmetronometM 1e-3 mul def % en kg
+ /mc \psk@oscmetronometm 1e-3 mul def % en kg
+ /dt \psk@oscmetronomedt def
+ /nT \psk@oscmetronomenT def
+ % moment d'inertie du métronome
+ % J=1/2M*R^2+M*a^2+m*x^2
+ /Ji {0.5 Md mul radius dup mul mul Md OA dup mul mul add mc xC dup mul mul add} def
+ /AT {4
+ Ji
+ gp Md OA mul mc xC mul sub mul
+ div
+ sqrt
+ mul} def
+ % Pour le calcul de la période
+ % coefficients de l'approximation polynômiale du calcul
+ % de l'intégrale elliptique
+% coefficient pour le calcul de l'intégrale elliptique
+ /m0 theta0 2 div sin def
+ /m1 {1 m0 dup mul sub} def
+ /m2 {m1 dup mul} def
+ /m3 {m2 m1 mul} def
+ /m4 {m2 dup mul} def
+ /m_1 {1 m1 div} def
+ /EllipticK {
+ 0.5
+ 0.12498593597 m1 mul add
+ 0.06880248576 m2 mul add
+ 0.03328355376 m3 mul add
+ 0.00441787012 m4 mul add
+ m_1 ln mul
+ 1.38629436112 add
+ 0.09666344259 m1 mul add
+ 0.03590092383 m2 mul add
+ 0.03742563713 m3 mul add
+ 0.01451196212 m4 mul add
+ } def
+/Tm {AT EllipticK mul} def
+% tableau des valeurs de theta(t)
+ /W 0 def % vitesse angulaire
+ /theta theta0 def
+ /oscillateur {sin gp Md OA mul mc xC mul sub mul neg mul Ji div} def
+ /j1 {W dt mul} def
+ /k1 {theta oscillateur dt mul} def
+ /j2 {W k1 2 div add dt mul} def
+ /k2 {theta j1 2 div rad2deg add oscillateur dt mul} def
+ /j3 {W k2 2 div add dt mul} def
+ /k3 {theta j2 2 div rad2deg add oscillateur dt mul} def
+ /j4 {W k3 add dt mul} def
+ /k4 {theta j3 rad2deg add oscillateur dt mul} def
+ /theta2 {theta j1 rad2deg 2 j2 rad2deg j3 rad2deg add mul add j4 rad2deg add 6 div add} def
+/tabTheta [ % pour l'animation
+ 0 theta0 % date angle
+dt dt Tm nT mul{ %
+ theta2 %
+ /W2 W k1 2 k2 k3 add mul add k4 add 6 div add def
+ /theta theta2 def
+ /W W2 def
+ } for
+ ] def
+/Nvaleurs tabTheta length 2 div cvi def
+ /W 0 def % vitesse angulaire
+ /theta theta0 def
+/tabThetaGraph [ % pour le graphique theta(t)
+ 0 theta0 % date angle
+0 dt Tm nT mul { % pop
+ theta2 % 180 div 3.14159 mul
+ /W2 W k1 2 k2 k3 add mul add k4 add 6 div add def
+ /theta theta2 def
+ /W W2 def
+ } for
+ ] def
+ /W 0 def % vitesse angulaire
+ /theta theta0 def
+/tabThetaPoint [ % pour le graphique thetapoint(t)
+ 0 0 % date angle
+dt dt Tm nT mul { % pop
+% theta2 % 180 div 3.14159 mul
+ /W2 W k1 2 k2 k3 add mul add k4 add 6 div add def
+ W2
+ /theta theta2 def
+ /W W2 def
+ } for
+ ] def
+/tabXOSC [ % oscillations par min en fonction de x
+0.5 0.1 12 {/xc exch def
+ /xC xc 1e-2 mul def
+ xc 60 Tm div % cvi
+ } for
+ ] def
+/tabXbattements [ % battements par min en fonction de x
+3 0.1 12 {/xc exch def
+ /xC xc 1e-2 mul def
+ xc 60 Tm div 2 mul % cvi
+ } for
+ ] def
+% graduation T --> x
+/tabXT [ % [T,x]
+ 40 1 220 {/batt exch def % battements
+ /Tmetronome2 120 batt div dup mul def
+ /A1 16 mc mul EllipticK dup mul mul def
+ /B1 gp Tmetronome2 mul mc mul def
+ /C1 gp Md mul OA mul Tmetronome2 mul neg
+ 8 Md mul radius dup mul mul 16 Md mul OA dup mul mul add EllipticK dup mul mul add def
+ /Delta B1 dup mul 4 A1 mul C1 mul sub sqrt def
+ /xC1 B1 neg Delta sub 2 div A1 div def
+ /xC2 B1 neg Delta add 2 div A1 div def
+ xC2 0 ge {/posC xC2 def}{/posC xC1 def} ifelse
+ batt posC 1e2 mul
+ } for
+ ] def
+/xT { % pour une valeur particulière battement -> position du curseur
+ /batt exch def
+ /Tmetronome2 120 batt div dup mul def
+ /A1 16 mc mul EllipticK dup mul mul def
+ /B1 gp Tmetronome2 mul mc mul def
+ /C1 gp Md mul OA mul Tmetronome2 mul neg
+ 8 Md mul radius dup mul mul 16 Md mul OA dup mul mul add EllipticK dup mul mul add def
+ /Delta B1 dup mul 4 A1 mul C1 mul sub sqrt def
+ /xC1 B1 neg Delta sub 2 div A1 div def
+ /xC2 B1 neg Delta add 2 div A1 div def
+ xC2 0 ge {/posC xC2 def}{/posC xC1 def} ifelse
+ posC 1e2 mul
+ } def
+/xC \psk@oscmetronomex 1e-2 mul def % position du curseur en m par rapport à l'axe
+/Tm {AT EllipticK mul} def
+ }%
+ \end@SpecialObj%
+\endgroup}
+%
+\def\psmetronomeA{\pst@object{psmetronomeA}}
+\def\psmetronomeA@i{%
+\begingroup%
+\use@par%
+ \begin@SpecialObj%
+ \pstVerb{%
+ /radius \psk@oscmetronomer 1e-2 mul def % en m
+ /OA \psk@oscmetronomed 1e-2 mul def % distance de l'axe au centre du disque en m
+ /xC \psk@oscmetronomex 1e-2 mul def % position du curseur en m par rapport à l'axe
+ }%
+\psframe[fillstyle=solid](! -0.075 \psk@oscmetronomed neg)(0.075,13)
+\pscircle[fillstyle=solid,fillcolor={[rgb]{0.75 0.75 0.75}}](! 0 \psk@oscmetronomed neg){!radius 1e2 mul}
+\pscircle[fillstyle=solid,linewidth=0.05](0,0){0.15}
+\pscircle*[linecolor=red](0,0){0.05}
+% curseur
+\pspolygon[fillstyle=solid](! -0.25 \psk@oscmetronomex 0.5 sub)(! -0.5 \psk@oscmetronomex 0.5 add)(!-0.075 \psk@oscmetronomex 0.5 add)(!-0.075 \psk@oscmetronomex 0.5 sub)
+\pspolygon[fillstyle=solid](! 0.25 \psk@oscmetronomex 0.5 sub)(! 0.5 \psk@oscmetronomex 0.5 add)(!0.075 \psk@oscmetronomex 0.5 add)(!0.075 \psk@oscmetronomex 0.5 sub)
+\pspolygon[fillstyle=solid,fillcolor=gray](! -0.25 \psk@oscmetronomex 0.5 sub)(! -0.3 \psk@oscmetronomex 0.3 sub)(! -0.075 \psk@oscmetronomex 0.3 sub)(!-0.075 \psk@oscmetronomex 0.3 add)(!0.075 \psk@oscmetronomex 0.3 add)(!0.075 \psk@oscmetronomex 0.3 sub)(!0.3 \psk@oscmetronomex 0.3 sub)(!0.25 \psk@oscmetronomex 0.5 sub)
+\pscircle[fillstyle=solid](!-0.125 \psk@oscmetronomex 0.4 sub){0.08}
+\pscircle[fillstyle=solid](!0.125 \psk@oscmetronomex 0.4 sub){0.08}
+% fin curseur
+{\psset{linecolor=red}
+\psline(!-.1 \psk@oscmetronomex)(!0.1 \psk@oscmetronomex)\psline(!0 \psk@oscmetronomex 0.1 sub)(!0 \psk@oscmetronomex 0.1 add)
+\psline(! -.1 \psk@oscmetronomed neg)(!0.1 \psk@oscmetronomed neg)\psline(! 0 \psk@oscmetronomed neg 0.1 sub)(!0 \psk@oscmetronomed neg 0.1 add)}
+\pnode(!0 \psk@oscmetronomex){C}% curseur
+\pnode(! 0 \psk@oscmetronomed neg){D}% disque
+\pstextpath[c](0,-2ex){\psarcn[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{m e t r o n o m e}}}
+\pstextpath[c](0,1ex){\psarc[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{P S t r i c k s}}}
+ \end@SpecialObj%
+\endgroup}
+\psmetronome%
+\pstVerb{/tabTempos [40 42 44 46 48 50 52 54 46 58 60 63 66 69 72 76 80 84 88 92 96 100 104 108 112 116 120 126 132 138 144 152 160 168 176 184 192 200 208] def}%
+
+\def\metronomebody{%
+ \pspolygon[fillstyle=solid,linewidth=2\pslinewidth,linearc=0.5,fillcolor=yellow!30](-5,-4.5)(5,-4.5)(1,14)(-1,14)
+ \psline(1.2,4.5)(1.2,12.5)
+ \psline(-1.2,4.5)(-1.2,12.5)
+ \multido{\i=0+2}{20}{%
+ \pstVerb{/BATT tabTempos \i\space get def}
+ \psline[linecolor=red](!1.2 BATT xT)(!0.7 BATT xT)
+ \uput[r](!0.7 BATT xT){\psPrintValue[PSfont=Helvetica,fontscale=6]{BATT}}
+ }%
+ \multido{\i=1+2}{19}{%
+ \pstVerb{/BATT tabTempos \i\space get def}
+ \psline[linecolor=red](!-1.2 BATT xT)(!-0.7 BATT xT)
+ \uput[r](!-1.3 BATT xT){\psPrintValue[PSfont=Helvetica,fontscale=6]{BATT}}}%
+ \rput(!0 40 xT){\textsf{\tiny GRAVE}}%
+ \rput(!0 46 xT){\textsf{\tiny LARGO}}%
+ \rput(!0 52 xT){\textsf{\tiny LENTO}}%
+ \rput(!0 58 xT){\textsf{\tiny ADAGIO}}%
+ \rput(!0 60 xT){\textsf{\tiny LARGETTO}}%
+ \rput(!0 66 xT){\textsf{\tiny ANDANTE}}%
+ \rput(!0 76 xT){\textsf{\tiny ANDANTINO}}%
+ \rput(!0 84 xT){\textsf{\tiny MODERATO}}%
+ \rput(!0 108 xT){\textsf{\tiny ALLEGRETTO}}%
+ \rput(!0 132 xT){\textsf{\tiny ALLEGRO}}%
+ \rput(!0 160 xT){\textsf{\tiny VIVACE}}%
+ \rput(!0 184 xT){\textsf{\tiny PRESTO}}%
+ \rput(!0 200 xT){\textsf{\tiny PRESTISSIMO}}%
+}
+
+\def\pendulum#1{%
+ \pstVerb{/iA #1\space def /date tabTheta iA get def /Theta tabTheta iA 1 add get def}%
+ \rput{!Theta}{\psmetronomeA}%
+}
+\makeatother
+\end{VerbatimOut}
+\begin{VerbatimOut}{metro.txt}
+::0x0, 1: annotRM['click'].callAS('play');
+::2
+::3
+::4
+::5
+::6
+::7
+::8
+::9
+::10
+::11
+::12
+::13
+::14
+::15
+::16
+::17
+::18
+::19
+::20
+::21
+::22
+::23
+::24
+::25
+::26: annotRM['click'].callAS('play');
+\end{VerbatimOut}
+%sound inclusion: click.mp3
+\includemedia[
+ label=click,
+ addresource=click.mp3,
+ activate=pageopen,
+ flashvars={source=click.mp3}
+]{}{APlayer.swf}%
+%loading metronome macros from external file
+\input{files/pstmetronome}
+%animated metronome
+\begin{animateinline}[
+ controls,
+ width=0.7\linewidth,
+ palindrome,
+ begin={\begin{pspicture}(-9.5,-5)(9.5,15)},
+ end={\end{pspicture}},
+ timeline=metro.txt
+]{25}
+ %metronome without pendulum
+ \metronomebody
+\newframe
+ %half period of pendulum swing (26 frames)
+ \multiframe{26}{i=0+4}{
+ \pendulum{\i}
+ }
+\end{animateinline}
+\caption{}\label{fig:metronome}
+\end{figure}
+\small
+\begin{verbatim}
+\documentclass[12pt]{article}
+\usepackage{pstricks,pst-node,pst-plot,pst-tools,pst-text}
+\usepackage{animate}
+\usepackage{media9}
+
+%writing timeline to external file
+\begin{filecontents}{metro.txt}
+::0x0, 1: annotRM['click'].callAS('play');
+::2
+::3
+::4
+::5
+::6
+::7
+::8
+::9
+::10
+::11
+::12
+::13
+::14
+::15
+::16
+::17
+::18
+::19
+::20
+::21
+::22
+::23
+::24
+::25
+::26: annotRM['click'].callAS('play');
+\end{filecontents}
+
+begin{document}
+
+\begin{center}
+ %sound inclusion: click.mp3
+ \includemedia[
+ label=click,
+ addresource=click.mp3,
+ activate=pageopen,
+ flashvars={source=click.mp3}
+ ]{}{APlayer.swf}%
+
+ %loading metronome macros from external file
+ \input{files/pstmetronome}
+
+ %animated metronome
+ \begin{animateinline}[
+ controls,
+ width=0.7\linewidth,
+ palindrome,
+ begin={\begin{pspicture}(-9.5,-5)(9.5,15)},
+ end={\end{pspicture}},
+ timeline=metro.txt
+ ]{25}
+ %metronome without pendulum
+ \metronomebody
+ \newframe
+ %half period of pendulum swing (26 frames)
+ \multiframe{26}{i=0+4}{
+ \pendulum{\i}
+ }
+ \end{animateinline}
+\end{center}
+
+\end{document}
+\end{verbatim}
+
\section{Bugs}\label{sect:bugs}
\begin{itemize}
\item The maximum frame rate that can actually be achieved largely depends on the complexity of the graphics and on the available hardware. Starting with version 8, Adobe Reader appears to be somewhat slower. However, you might want to experiment with the graphical hardware acceleration feature that was introduced in Reader 8. Go to menu `Edit' $\rightarrow$ `Preferences' $\rightarrow$ `Page Display' $\rightarrow$ `Rendering' to see whether hardware acceleration is available. A 2D GPU acceleration check box will be visible if a supported video card has been detected.
@@ -947,10 +1328,11 @@ Note that the name of the Ghostscript executable may vary between operating syst
I would like to thank Fran\c{c}ois Lafont who discovered quite a few bugs and made many suggestions that helped to improve the functionality of the package. Many thanks to Jin-Hwan Cho, the developer of `\verb+dvipdfmx+', for contributing the `\verb+dvipdfmx+' specific code, and to Walter Scott for proof-reading the documentation.
\begin{thebibliography}{8}
- \bibitem{chupin} Chupin, M.: \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\tt http://melusine.eu.org/syracuse/metapost/animations/} \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\tt chupin/?idsec=scara}
- \bibitem{gilg05} Gilg, J.: PDF-Animationen. In: \emph{Die \TeX nische Kom\"odie}, Issue 4, 2005, pp.~30--37
- \bibitem{hol} Hole\v{c}ek, J.: \emph{Animations in a pdf\TeX-generated PDF}. URL: \href{http://www.fi.muni.cz/~xholecek/tex/pdfanim.xhtml}{\tt http://www.} \href{http://www.fi.muni.cz/~xholecek/tex/pdfanim.xhtml}{\tt fi.muni.cz/\textasciitilde xholecek/tex/pdfanim.xhtml}
- \bibitem{movie15} \emph{The Movie15 Package}. URL: \href{http://www.ctan.org/tex-archive/macros/latex/contrib/movie15/}{\tt http://www.ctan.org/tex-archive/macros/} \href{http://www.ctan.org/tex-archive/macros/latex/contrib/movie15/}{\tt latex/contrib/movie15}
+\bibitem{chupin} Chupin, M.: \emph{Syracuse MetaPost/Animations.} URL: \url{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}
+\bibitem{gilg05} Gilg, J.: PDF-Animationen. In: \emph{Die \TeX nische Kom\"odie}, Issue 4, 2005, pp.~30--37
+\bibitem{hol} Hole\v{c}ek, J.: \emph{Animations in a pdf\TeX-generated PDF}. URL: \url{http://www.fi.muni.cz/~xholecek/tex/pdfanim.xhtml}
+\bibitem{luque12} Luque, M.: \emph{PSTricks : applications.} URL: \url{http://pstricks.blogspot.com}
+\bibitem{media9} \emph{The media9 Package}. URL: \url{http://www.ctan.org/tex-archive/macros/latex/contrib/media9/}
\end{thebibliography}
\end{document}