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')
-rwxr-xr-xMaster/texmf-dist/doc/latex/animate/animate.tex75
1 files changed, 44 insertions, 31 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/animate.tex b/Master/texmf-dist/doc/latex/animate/animate.tex
index acef6dbfa3a..15dad014b46 100755
--- a/Master/texmf-dist/doc/latex/animate/animate.tex
+++ b/Master/texmf-dist/doc/latex/animate/animate.tex
@@ -253,7 +253,7 @@ end={<end text>}
(`\verb+animateinline+' only.) \verb+<begin text>+ and \verb+<end text>+ are inserted into the code at start and end of each frame. Mainly used for setting up some drawing environment, such as
\begin{verbatim}
begin={\begin{pspicture}(...)(...)}, end={\end{pspicture}}
-\end{verbatim}
+\end{verbatim}
\subsection{The `{\tt timeline}' option}\label{sect:timeline}
\begin{verbatim}
@@ -378,7 +378,7 @@ Contents of file `timeline.txt':
\caption{}\label{fig:taylor}
\end{figure}
-The second, somewhat more complex example, Fig.~\ref{fig:scarab}, animates the geometric construction of a scarabaeus. In addition to the use of a timeline, it introduces the layer concept. This example is adapted from Maxime Chupin's original \MP{} source file \cite{chupin}. The present version separates stationary from moving parts of the drawing and saves them into different files. A total of 254 files, scarab\_0.mps through scarab\_253.mps, is written out by running `\verb+mpost --tex=latex+' on the source file `scarab.mp'. Files 0 through 100 contain the red line segments that make up the growing scarabaeus. Files 101 through 201 contain the moving construction lines and files 202 through 252 contain the gray lines which represent intermediate stages of the construction. The last file, No. 253, contains the coordinate axes, two stationary construction lines and the labels which do not move. A timeline file is written on-the-fly during the \LaTeX{} run. It arranges the animation into three layers, forcing the gray lines into the background, the coordinate axes into the intermediate layer and the scarabaeus along with the moving construction lines into the foreground. The final animation consists of 101 individual frames.
+The second, somewhat more complex example, Fig.~\ref{fig:scarab}, animates the geometric construction of a scarabaeus. In addition to the use of a timeline, it introduces the layer concept. This example is adapted from Maxime Chupin's original \MP{} source file \cite{chupin}. The present version separates stationary from moving parts of the drawing and saves them into different files. A total of 254 files, scarab\_0.mps through scarab\_253.mps, is written out by running `\verb+mpost --tex=latex+' on the source file `scarab.mp'. Files 0 through 100 contain the red line segments that make up the growing scarabaeus. Files 101 through 201 contain the moving construction lines and files 202 through 252 contain the gray lines which represent intermediate stages of the construction. The last file, No. 253, contains the coordinate axes, two stationary construction lines and the labels which do not move. A timeline file `scarab.tln' is written out on-the-fly during the \LaTeX{} run. It arranges the animation into three layers, forcing the gray lines into the background, the coordinate axes into the intermediate layer and the scarabaeus along with the moving construction lines into the foreground. The final animation consists of 101 individual frames.
\begin{figure}[t]
\centering
\newcounter{scarab}
@@ -389,7 +389,7 @@ The second, somewhat more complex example, Fig.~\ref{fig:scarab}, animates the g
\setcounter{grayline}{202}
%
\newwrite\TimeLineFile
-\immediate\openout\TimeLineFile\jobname.tln
+\immediate\openout\TimeLineFile=scarab.tln
\whiledo{\thescarab<101}{
\ifthenelse{\intcalcMod{\thescarab}{2}=0}{
\immediate\write\TimeLineFile{::\thegrayline x0;253;\thescarab x0,\theblueline}
@@ -406,7 +406,7 @@ The second, somewhat more complex example, Fig.~\ref{fig:scarab}, animates the g
width=0.8\linewidth,
controls,
loop,
- timeline=\jobname.tln
+ timeline=scarab.tln
]{12}{scarab_}{0}{253}
%
\caption{}\label{fig:scarab}
@@ -428,7 +428,7 @@ The second, somewhat more complex example, Fig.~\ref{fig:scarab}, animates the g
%write timeline file
\newwrite\TimeLineFile
-\immediate\openout\TimeLineFile\jobname.tln
+\immediate\openout\TimeLineFile=scarab.tln
\whiledo{\thescarab<101}{
\ifthenelse{\intcalcMod{\thescarab}{2}=0}{
%a gray line is added to every 2nd frame
@@ -450,7 +450,7 @@ The second, somewhat more complex example, Fig.~\ref{fig:scarab}, animates the g
\animategraphics[
width=0.8\linewidth,
controls, loop,
- timeline=\jobname.tln
+ timeline=scarab.tln
]{12}{scarab_}{0}{253}
\end{center}
@@ -556,9 +556,20 @@ 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' do not work if the loop body contains {\tt\string\newframe}. Use {\tt\string\whiledo} from package `if\/then' instead. (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 `{\tt fp}'. For example:
+ \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}'s or {\tt tikzpicture}'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'
@@ -568,50 +579,52 @@ Fig.~\ref{fig:torus} is an inline graphics example adapted from \cite{gilg05}.
%initialize loop counter and `n'
\setcounter{iter}{0}%
\FPset{n}{nInit}%
- ...
- ... create first frame using `\n' (Mind the backslash!)
- ... (\multido _can_ be used here!)
- ...
+ %
+ %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'
- ... (\multido _can_ be used here!)
- ...
+ %
+ %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:
\begin{enumerate}
\item Open a command line window.
- \item\label{item:firststep} At the DOS prompt, enter\\
- {\tt initexmf -{}-edit-config-file=latex}
- \item Type\\
- {\tt main\_memory=10000000}\\
- into the editor window that opens, save the file and quit the editor.
- \item\label{item:laststep} To rebuild the format, enter\\
- {\tt initexmf -{}-dump=latex}
- \item Repeat steps \ref{item:firststep}--\ref{item:laststep} with config file `{\tt pdflatex}'
+ \item\label{item:firststep} At the DOS prompt, enter\\
+ {\tt initexmf -{}-edit-config-file=latex}
+ \item Type\\
+ {\tt main\_memory=10000000}\\
+ into the editor window that opens, save the file and quit the editor.
+ \item\label{item:laststep} To rebuild the format, enter\\
+ {\tt initexmf -{}-dump=latex}
+ \item Repeat steps \ref{item:firststep}--\ref{item:laststep} with config file `{\tt pdflatex}'
\end{enumerate}
\TeX\ Live:
\begin{enumerate}
- \item Find the configuration file `texmf.cnf' by means of\\
- {\tt kpsewhich texmf.cnf}\\
- at the shell prompt in a terminal.
- \item As Root, open the file in your favourite text editor, scroll to the `{\tt main\_memory}' entry and change it to the value given above; save and quit.
- \item Rebuild the formats by\\
- {\tt fmtutil-sys -{}-byfmt latex}\\
- {\tt fmtutil-sys -{}-byfmt pdflatex}
+ \item Find the configuration file `texmf.cnf' by means of\\
+ {\tt kpsewhich texmf.cnf}\\
+ at the shell prompt in a terminal.
+ \item As Root, open the file in your favourite text editor, scroll to the `{\tt main\_memory}' entry and change it to the value given above; save and quit.
+ \item Rebuild the formats by\\
+ {\tt fmtutil-sys -{}-byfmt latex}\\
+ {\tt fmtutil-sys -{}-byfmt pdflatex}
\end{enumerate}
\item Animations should not be placed on \emph{multilayered} slides created with presentation making classes such as Beamer or Powerdot. Although possible, the result might be disappointing. Put animations on flat slides only. (Of course, slides without animations may still have overlays.)