summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/animate/animate.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-07-14 22:18:15 +0000
committerKarl Berry <karl@freefriends.org>2008-07-14 22:18:15 +0000
commit3dbde31e7c26ef198ab0939714f3a513049a9afb (patch)
tree19b19d1a22f5bf28ba6f7894836f5e173dbc3fc2 /Master/texmf-dist/doc/latex/animate/animate.tex
parent23c7f66c5212d122c76342854f2fe85653365a75 (diff)
animate update (14jul08)
git-svn-id: svn://tug.org/texlive/trunk@9558 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/animate/animate.tex')
-rwxr-xr-xMaster/texmf-dist/doc/latex/animate/animate.tex131
1 files changed, 65 insertions, 66 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/animate.tex b/Master/texmf-dist/doc/latex/animate/animate.tex
index 96396157ea8..403a202da78 100755
--- a/Master/texmf-dist/doc/latex/animate/animate.tex
+++ b/Master/texmf-dist/doc/latex/animate/animate.tex
@@ -99,7 +99,7 @@ Unzip the file `animate.tds.zip' into the local TDS root directory which can be
After installation, update the filename database by running `\verb+texhash+' on the command line.
-MiKTeX users should run the package manager for installation.
+MiK\TeX{} users should run the package manager for installation.
\section{Using the package}
First of all, read Section~\ref{sect:bugs} on problems related to this package. Then, invoke the package by putting the line
@@ -148,6 +148,10 @@ and the environment
... typeset material ...
\newframe*[<frame rate>]
... typeset material ...
+\newframe
+\multiframe{<number of frames>}{[<variables>]}{
+ ... repeated (parameterized) material ...
+}
\end{animateinline}
\end{verbatim}
@@ -155,6 +159,12 @@ While \verb+\animategraphics+ can be used to assemble animations from sets of ex
The command \verb+\newframe+ terminates a frame and starts the next one. It can be used inside the `\verb+animateinline+' environment only. There is a starred variant, \verb+\newframe*+. If placed after a particular frame it causes the animation to pause at that frame. The animation continues normally after clicking it again. Both \verb+\newframe+ variants take an optional argument that allows to change the frame rate in the middle of an animation.
+The command `\verb+\multiframe+' allows to build loops around pictures. The first argument \verb+<number of frames>+ does what one would expect it to do. The second argument \verb+<variables>+ is a comma-separated list of variable declarations which may be of arbitrary, including zero, length. Variables may be used to parameterize pictures which are defined in the loop body (third argument of \verb+\multiframe+). A single variable declaration has the form
+\begin{verbatim}
+ <variable name>=<initial value>+<increment>
+\end{verbatim}
+\verb+<variable name>+ is a sequence of one or more letters \emph{without} a leading backslash. The first (and possibly only) letter of the variable name determines the type of the variable. There are three different types: integers (`\verb+i+', `\verb+I+'), reals (`\verb+n+', `\verb+N+', `\verb+r+', `\verb+R+') and dimensions or \LaTeX{} lengths (`\verb+d+', `\verb+D+'). Upon first execution of the loop body, the variable takes the value \verb+<initial value>+. Each further iteration increments the variable by \verb+<increment>+. Negative increments must be preceded by `\verb+-+'. Here are some examples: `\verb:i=1+2:', `\verb:Rx=10.0+-2.25:', `\verb:dim=20pt+1ex:'. Within the loop body, the variables may be expanded by preceding their name with a backslash, that is \verb+\i+, \verb+\Rx+ and \verb+\dim+ according to the previous examples. \verb+\multiframe+ must be surrounded by \verb+\begin{animateinline}+ and \verb+\end{animateinline}+ or by any of the \verb+\newframe+ variants. Two consecutive \verb+\multiframe+ commands must be separated by one of the \verb+\newframe+ variants.
+
By default, the animation is built frame by frame in the order of inclusion of the embedded material. However, extended control of the order of appearance, superposition and repetition of the material is available through the `\verb+timeline+' option (see Section~\ref{sect:timeline}).
\myparagraph*{Sets of graphics files}
@@ -282,7 +292,7 @@ Each line of the timeline file that is not blank and which does not begin with a
\end{verbatim}
While any field may be left blank, the 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 third field \verb+<frame content>+ is a comma-separated list of \emph{transparency specifications} that determines the content of the frame. A \emph{single} transparency specification obeys the syntax
+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 third field \verb+<frame content>+ is a comma-separated \emph{list} of \emph{transparency specifications} that determines the content of the frame. A \emph{single} transparency specification obeys the syntax
\begin{verbatim}
<transparency ID>[x<number of frames>]
\end{verbatim}
@@ -342,7 +352,7 @@ The stack-like concept of animations, where transparencies are always put on top
...
\end{verbatim}
\normalsize
-In this timeline, the transparencies are grouped into two layers. One is reserved for the background images, transparencies No. 0 \& 1, to be exchanged after 49 frames, and another one for the foreground objects that are successively added to the scene. As can be seen in this example, layers need not be explicitly populated; the leading semicolons just ensure the proper relationship between transparencies and animation layers. Note that \emph{without} setting up two layers, the foreground objects on transparencies 2 through 99 that have been added during the first 49 frames would be overprinted by the new background image, transparency 1, from frame 50 onward.
+In this timeline, the transparencies are grouped into two layers. One is reserved for the background images, transparencies No. 0 \& 1, to be exchanged after 49 frames, and another one for the foreground objects that are successively added to the scene. As can be seen in this example, layers need not be explicitly populated; the leading semicolons just ensure the proper relationship between transparencies and animation layers. Note that \emph{without} setting up two layers, that is, by replacing the semicolons with commas, the foreground objects on transparencies 2 through 99 which have been added during the first 49 frames would be overprinted by the new background image, transparency 1, from frame 50 onward.
See the second animation, Fig.~\ref{fig:scarab}, in Section~\ref{sect:examples} for a working example that makes use of the timeline and the layer concept.
@@ -494,7 +504,7 @@ Fig.~\ref{fig:torus} is an inline graphics example adapted from \cite{gilg05}.
t cos 4 mul
}%
\FPupn\strokewidth{360 #1 sub 360 div 3 mul}%
- \parametricplotThreeD[yPlotpoints=1,linewidth=\strokewidth pt](0,360)(#1,#1){%
+ \parametricplotThreeD[yPlotpoints=1,linewidth=\strokewidth pt](0,360)(#1,#1){%
u cos 2 mul 4 t sin 2 mul add mul
u sin 2 mul 4 t sin 2 mul add mul
t cos 4 mul
@@ -505,16 +515,10 @@ Fig.~\ref{fig:torus} is an inline graphics example adapted from \cite{gilg05}.
\begin{document}
\begin{center}
-\newcounter{torusangle}
-\setcounter{torusangle}{80}
-
\begin{animateinline}[poster=last,controls,palindrome]{10}%
- \torus{\thetorusangle}%
- \whiledo{\thetorusangle<360}{%
- \newframe%
- \addtocounter{torusangle}{10}%
- \torus{\thetorusangle}%
- }
+ \multiframe{29}{iAngle=80+10}{% 80, 90, ..., 360 degrees
+ \torus{\iAngle}%
+ }%
\end{animateinline}%
\end{center}
@@ -546,15 +550,10 @@ Fig.~\ref{fig:torus} is an inline graphics example adapted from \cite{gilg05}.
\end{pspicture}%
}
-\newcounter{torusangle}
-\setcounter{torusangle}{80}
\begin{animateinline}[poster=last,controls,palindrome]{10}%
- \torus{\thetorusangle}%
- \whiledo{\thetorusangle<360}{%
- \newframe%
- \addtocounter{torusangle}{10}%
- \torus{\thetorusangle}%
- }
+ \multiframe{29}{iAngle=80+10}{%
+ \torus{\iAngle}%
+ }%
\end{animateinline}%
\caption{}\label{fig:torus}
\end{figure}
@@ -569,51 +568,51 @@ Fig.~\ref{fig:torus} is an inline graphics example adapted from \cite{gilg05}.
\item Animations do not work if the PDF has been produced with Ghostscript versions older than 8.31. This applies to all versions of ESP Ghostscript that comes with many Linux distributions.
- \item The command {\tt\string\multido} and its relatives from package `multido' as well as {\tt\string\foreach} from the `pgf/TikZ' package do not work \emph{if their loop body} contains {\tt\string\newframe}. Instead, use {\tt\string\whiledo} from package `if\/then' if you wish to construct loops around parameterized {\tt pspicture}\emph{s} or {\tt tikzpicture}\emph{s}. (There is no need to load `if\/then' explicitly; it has already been loaded by `animate'.) A counter must be declared to keep track of the number of iterations. Further variables that take fixed point decimals to be used within the loop body can be defined and incremented by means of the commands \verb+\FPset+ and \verb+\FPeval+ from package `fp'. Note that {\tt\string\multido} and {\tt\string\foreach} \emph{can} safely be used \emph{within} the code of the frames. For example:
-\small
-\begin{verbatim}
-
-%parameterized `tikzpicture'
-\newcommand{\PicWithParam}[1]{%
- \begin{tikzpicture}%
- ...
- ... code making use of parameter #1,
- ... \multido & \foreach _can_ be used here!
- ...
- \end{tikzpicture}%
-}
-
-\newcounter{iter} % declare loop counter
-
-\FPset{nInit}{1.0}% initial value of variable `n'
-\FPset{nIncr}{0.5}% increment of `n'
-
-\begin{animateinline}{12}
- %initialize loop counter and `n'
- \setcounter{iter}{0}%
- \FPset{n}{nInit}%
- %
- %create first frame using `\n' (Mind the backslash!)
- \PicWithParam{\n}%
- %
- \whiledo{\theiter<50}{% another 50 frames
- %start new frame
- \newframe%
- %
- %increment loop counter by 1
- \stepcounter{iter}%
- %
- %calculate new value of `n'
- \FPeval{n}{nInit+nIncr*\theiter}%
- %
- %create frame using `\n' (Mind the backslash!)
- \PicWithParam{\n}%
- %
- }
-\end{animateinline}
-\end{verbatim}
-\normalsize
-
+% \item The command {\tt\string\multido} and its relatives from package `multido' as well as {\tt\string\foreach} from the `pgf/TikZ' package do not work \emph{if their loop body} contains {\tt\string\newframe}. Instead, use {\tt\string\whiledo} from package `if\/then' if you wish to construct loops around parameterized {\tt pspicture}\emph{s} or {\tt tikzpicture}\emph{s}. (There is no need to load `if\/then' explicitly; it has already been loaded by `animate'.) A counter must be declared to keep track of the number of iterations. Further variables that take fixed point decimals to be used within the loop body can be defined and incremented by means of the commands \verb+\FPset+ and \verb+\FPeval+ from package `fp'. Note that {\tt\string\multido} and {\tt\string\foreach} \emph{can} safely be used \emph{within} the code of the frames. For example:
+%\small
+%\begin{verbatim}
+%
+%%parameterized `tikzpicture'
+%\newcommand{\PicWithParam}[1]{%
+% \begin{tikzpicture}%
+% ...
+% ... code making use of parameter #1,
+% ... \multido & \foreach _can_ be used here!
+% ...
+% \end{tikzpicture}%
+%}
+%
+%\newcounter{iter} % declare loop counter
+%
+%\FPset{nInit}{1.0}% initial value of variable `n'
+%\FPset{nIncr}{0.5}% increment of `n'
+%
+%\begin{animateinline}{12}
+% %initialize loop counter and `n'
+% \setcounter{iter}{0}%
+% \FPset{n}{nInit}%
+% %
+% %create first frame using `\n' (Mind the backslash!)
+% \PicWithParam{\n}%
+% %
+% \whiledo{\theiter<50}{% another 50 frames
+% %start new frame
+% \newframe%
+% %
+% %increment loop counter by 1
+% \stepcounter{iter}%
+% %
+% %calculate new value of `n'
+% \FPeval{n}{nInit+nIncr*\theiter}%
+% %
+% %create frame using `\n' (Mind the backslash!)
+% \PicWithParam{\n}%
+% %
+% }
+%\end{animateinline}
+%\end{verbatim}
+%\normalsize
+%
\item Animations with complex graphics and/or many frames may cause \LaTeX{} to fail with a `\verb+TeX capacity exceeded+' error. The following steps should fix most of the memory related problems.
MiK\TeX: