summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-04-05 16:25:24 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-04-05 16:25:24 +0000
commitc22218e7ddbe40ed021b55cd62d978f11dae15c4 (patch)
tree890f3e64970b2471f6a100a59dceaedad44b28ac
parent9a07861bd1378991bf590f24562dac6b26631673 (diff)
animate v2008/04/01
git-svn-id: svn://tug.org/texlive/trunk@7319 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/animate/README2
-rw-r--r--Master/texmf-dist/doc/latex/animate/doc/animate.pdfbin1315622 -> 1319681 bytes
-rw-r--r--Master/texmf-dist/doc/latex/animate/doc/animate.tex22
-rw-r--r--Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp2
-rw-r--r--Master/texmf-dist/tex/latex/animate/animate.sty38
5 files changed, 54 insertions, 10 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/README b/Master/texmf-dist/doc/latex/animate/README
index ba97e38b990..35347cef7b2 100644
--- a/Master/texmf-dist/doc/latex/animate/README
+++ b/Master/texmf-dist/doc/latex/animate/README
@@ -73,7 +73,7 @@ Usage:
* Command options: width=<width>, height=<height>, depth=<depth>,
scale=<factor>, autopause, autoplay, autoresume, final,
draft, controls, buttonsize=<size>, buttonbg=<colour>,
- buttonfg=<colour>, loop, palindrome, step,
+ buttonfg=<colour>, loop, palindrome, step, measure,
poster[=first | none | last], begin={<begin text>},
end={<end text>}, timeline=<timeline file>,
every=<number>, bb=<llx> <lly> <urx> <ury>,
diff --git a/Master/texmf-dist/doc/latex/animate/doc/animate.pdf b/Master/texmf-dist/doc/latex/animate/doc/animate.pdf
index e265ea3e808..15598aabfc6 100644
--- a/Master/texmf-dist/doc/latex/animate/doc/animate.pdf
+++ b/Master/texmf-dist/doc/latex/animate/doc/animate.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/animate/doc/animate.tex b/Master/texmf-dist/doc/latex/animate/doc/animate.tex
index 76305195f24..ebcf2b338d9 100644
--- a/Master/texmf-dist/doc/latex/animate/doc/animate.tex
+++ b/Master/texmf-dist/doc/latex/animate/doc/animate.tex
@@ -12,6 +12,7 @@
\usepackage{animate}
\usepackage{intcalc}
\usepackage{graphicx}
+\usepackage{color}
\usepackage{hyperref}
\usepackage{textcomp}
\usepackage{lmodern}
@@ -20,9 +21,16 @@
\usepackage{microtype}
\usepackage{ifpdf}
\usepackage{parskip}
+\clubpenalty=10000
+\widowpenalty=10000
+\displaywidowpenalty=10000
\makeatletter
\renewcommand{\fnum@figure}[1]{\figurename~\thefigure}
+\newcommand\myparagraph{\@startsection{paragraph}{3}{\z@}%
+ {\parskip}%
+ {0.001\parskip}%
+ {\itshape\normalsize}}
\makeatother
\ifpdf
@@ -109,7 +117,7 @@ poster[=first | none | last]
\end{verbatim}
The same options (among others) are also available as command options and will be explained shortly. However, if used as package options they have global scope, taking effect on all animations in the document. In turn, command options locally override global settings.
-If PDF is generated via DVI and Postscript by the command sequence \verb+latex+ $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+, the `graphicx' package is required. \emph{Important:} The \verb+dvips+ option `\verb+-Ppdf+' should \emph{not} be set when converting the intermediate DVI into Postscript. If you cannot do without, put `\verb+-X 2400 -Y 2400+' \emph{after} `\verb+-Ppdf+' on the command line. Sometimes, if the same animation sequence made from graphics files is to be embedded multiple times into the document, more compact PDF output may be obtained by passing option `\verb+-dMaxInlineImageSize=0+' to \verb+ps2pdf+.
+If PDF is generated via DVI and Postscript by the command sequence \verb+latex+ $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+, the `graphicx' package is required. \emph{Important:} The \verb+dvips+ option `\verb+-Ppdf+' should \emph{not} be set when converting the intermediate DVI into Postscript. If you cannot do without, put `\verb+-X 2400 -Y 2400+' \emph{after} `\verb+-Ppdf+' on the command line. Sometimes, if the same animation sequence made from graphics files is to be embedded multiple times into the document, more compact PDF output may be obtained by passing option `\verb+-dMaxInlineImageSize=0+' (Unix) or `\verb+-dMaxInlineImageSize#0+' (Win/DOS) to \verb+ps2pdf+.
\section{The user interface}
Package `animate' provides the command
@@ -133,7 +141,7 @@ By default, the animation is built frame by frame in the order of inclusion of t
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.
-\emph{Sets of graphics files}\\[0.8\parskip]
+\myparagraph*{Sets of graphics files}
All files of the sequence should exist and be consecutively numbered. (Exception to this rule is allowed in connexion with the `\verb+every+' option, see below.) {\tt <file base\-name>} is the leftmost part of the file name that is common to all members of the sequence. \verb+<first>+ is the number of the first and \verb+<last>+ the number of the last file in the set. File names may be simply numbered, such as $0\dots99$. If there are leading zeros, make sure that all file numbers have the same number of digits, such as $0000\dots0099$.
There is no file name extension to be specified as a parameter. The possible file formats depend on whether \LaTeX{} or pdf\LaTeX{} is used. In the case of \LaTeX{}, files with the extension `eps' are searched for at first, followed by `mps' (\MP-generated Postscript) and `ps'. With pdf\LaTeX{} the searching order is: (1)~`pdf', (2)~`mps', (3)~`png', (4)~`jpg', (5)~`jpeg', (6)~`jbig2', (7)~`jb2', (8)~`jp2'\footnotemark[1], (9)~`j2k'\footnotemark[1], (10)~`jpx'\footnotemark[1]\footnotetext[1]{JPEG2000 is not yet supported by pdf\TeX.}. That is, files capable to store vector graphics are found first. Make sure that all file names have \emph{lower case} extensions.
@@ -143,7 +151,7 @@ For example, given the sequence `frame\_5.png' through `frame\_50.png' from a po
\animategraphics{12}{frame_}{5}{50}
\end{verbatim}
-\emph{Multipage PDF inclusion (pdf\LaTeX{} only)}\\[0.8\parskip]
+\myparagraph*{Multipage PDF inclusion (pdf\LaTeX{} only)}
If the file `\verb+<file basename>+.pdf' exists (again, there is no file name extension to be specified), it is taken as a multipage document where each page represents one frame of the animation. In this case, the last two arguments, \verb+<first>+ \& \verb+<last>+, are interpreted differently from above; they specify a zero-based range of pages to be included in the animation. Either or both of them may be left empty, `\verb+{}+', in which case they default to $0$ and $n-1$, where $n$ is the total number of available pages. Arguments that fall outside this range are automatically corrected to the maximum allowed number, i.\,e. $n-1$.
For example, the line
@@ -228,6 +236,10 @@ final
\end{verbatim}
With `\verb+draft+' the animation is not embedded. Instead, a box with the exact dimensions of the animation is inserted. Option `\verb+final+' does the opposite as it forces the animation to be built and embedded. Both options can be used to reduce compilation time during authoring of a document. To get the most out of them it is recommended to set `\verb+draft+' globally as package or class option and to set `\verb+final+' locally as a command option of the animation that is currently worked on. After the document has been finished, the global `\verb+draft+' option can be removed to embed all animations.
\begin{verbatim}
+measure
+\end{verbatim}
+Measures the frame rate during one cycle of the animation. (For testing purposes.)
+\begin{verbatim}
begin={<begin text>}
end={<end text>}
\end{verbatim}
@@ -295,7 +307,7 @@ When designing the timeline, care should be taken not to include a transparency
\end{verbatim}
\normalsize
-\emph{Grouping objects into layers using `{\tt;}'}\\[0.8\parskip]
+\myparagraph*{Grouping objects into layers using `{\tt;}'}
The stack-like concept of animations, where transparencies are always put on top such that they overprint the content of previously deposited transparencies, can be inconvenient in certain situations. For example, it might be desirable to allow for changing the background image in the middle of an animation without affecting objects that are located in the foreground. For this purpose, transparency specifications can be grouped into \emph{layers} using the semicolon (\verb+;+) as a separator instead of the comma. This is best illustrated by an example:
\small
\begin{verbatim}
@@ -315,6 +327,7 @@ In this timeline, the transparencies are grouped into two layers. One is reserve
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.
\section{Examples}
+{\Large\color{red}{\sc Note:} Examples do not run in Adobe Reader 8!}
\subsection[Animations from sets of files, using `animategraphics' command]{Animations from sets of files, using {\tt \string\animategraphics} command}\label{sect:examples}
Animations in this section are made from graphics files that were prepared with \MP. Run `\verb+mpost --tex=latex+' on the files ending in `.mp' in the `doc/files' directory to generate the graphics files. Both examples make use of the `\verb+timeline+' option to reduce the resulting PDF file size.
@@ -532,7 +545,6 @@ Fig.~\ref{fig:torus} is an inline graphics example adapted from \cite{gilg05}.
\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:
\small
\begin{verbatim}
-
\newcounter{iter} % declare loop counter
\FPset{nInit}{1.0}% initial value of variable `n'
diff --git a/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp b/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp
index d17cf5b2926..bef95226e24 100644
--- a/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp
+++ b/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp
@@ -1,7 +1,7 @@
% Maxime Chupin, Alexander Grahn
% 2008/01/03
-%filenametemplate "%j_%c.mps";
+filenametemplate "%j_%c.mps";
verbatimtex
\documentclass{article}
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty
index 4d87f51dd5d..8b774b6a056 100644
--- a/Master/texmf-dist/tex/latex/animate/animate.sty
+++ b/Master/texmf-dist/tex/latex/animate/animate.sty
@@ -13,7 +13,7 @@
% Supports LaTeX->dvips->ps2pdf or pdfLaTeX workflows.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{animate}[2008/03/26]
+\ProvidesPackage{animate}[2008/04/01]
%test for e-TeX
\ifx\eTeXversion\@undefined%
@@ -2118,6 +2118,10 @@
\if@anim@grxloaded\xdef\@anim@gropts{\@anim@gropts, trim=#1}%
\else\@anim@missing{graphicx}\fi%
}
+\newboolean{@anim@meas}
+\define@key{anim@user}{measure}[true]{%
+ \setboolean{@anim@meas}{#1}%
+}
%macro to reset macros and booleans
\def\@anim@reset{%
@@ -2156,6 +2160,7 @@
\gdef\@anim@every{1}% frames to be included
\gdef\@anim@gropts{}%
\setboolean{@anim@multipdf}{false}%
+ \setboolean{@anim@meas}{false}%
}
%package options
@@ -2411,6 +2416,7 @@
a#1.fr[a#1.idx].state=false;%
try{%
a#1.fr[++a#1.idx].state=true;%
+ \if@anim@step\else\if@anim@meas a#1.frcnt++;\fi\fi%
}catch(e){%
--a#1.idx;%
\if@anim@palindrome%
@@ -2419,6 +2425,7 @@
a#1.playsRight=false;%
\else
a#1.fr[a#1.idx].state=true;%
+ \if@anim@meas if(a#1.isPlaying){a#1.stopMeas();}\fi
if(a#1.isPlaying){a#1.isPaused=true;a#1.actnPlayLeft();}%
\fi%
\else%
@@ -2461,6 +2468,7 @@
a#1.fr[a#1.idx].state=false;%
try{%
a#1.fr[--a#1.idx].state=true;%
+ \if@anim@step\else\if@anim@meas a#1.frcnt++;\fi\fi%
}catch(e){%
++a#1.idx;%
\if@anim@palindrome%
@@ -2469,6 +2477,7 @@
a#1.playsRight=true;%
\else
a#1.fr[a#1.idx].state=true;%
+ \if@anim@meas if(a#1.isPlaying){a#1.stopMeas();}\fi
if(a#1.isPlaying){a#1.isPaused=true;a#1.actnPlayRight();}%
\fi%
\else%
@@ -2509,6 +2518,7 @@
};%
\if@anim@step\else
a#1.actnPause=function(){%
+ \if@anim@meas if(a#1.isPlaying){a#1.stopMeas();}\fi
try{app.clearInterval(a#1_int);}catch(e){}%
a#1.isPlaying=false;%
a#1.isPaused=true;%
@@ -2530,7 +2540,8 @@
a#1.btn['PlayLeft'].state=false;%
a#1.btn['PauseRight'].state=true;%
a#1.btn['PlayRight'].state=false;%
- \fi
+ \fi%
+ \if@anim@meas a#1.startMeas();\fi
a#1_int=app.setInterval('a#1.actnNext()',a#1.dt);%
};%
a#1.actnPlayLeft=function(){%
@@ -2544,7 +2555,8 @@
a#1.btn['PlayLeft'].state=false;%
a#1.btn['PauseRight'].state=true;%
a#1.btn['PlayRight'].state=false;%
- \fi
+ \fi%
+ \if@anim@meas a#1.startMeas();\fi
a#1_int=app.setInterval('a#1.actnPrev()',a#1.dt);%
};%
\if@anim@controls
@@ -2583,6 +2595,26 @@
};%
\fi%
\fi%
+ \if@anim@step\else%
+ \if@anim@meas
+ var spc=String.fromCharCode(32);%
+ a#1.frcnt=0;% frame counter for speed measurements
+ a#1.msStart=0;% takes start time (in millisecs)
+ a#1.msEnd=0;% takes end time (in millisecs)
+ a#1.startMeas=function(){%
+ a#1.frcnt=0;% reset frame counter
+ a#1.msStart=(new Date()).getTime();%
+ };%
+ a#1.stopMeas=function(){%
+ a#1.msEnd=(new Date()).getTime();%
+ app.alert({%
+ cMsg:'av.'+spc+'frame'+spc+'rate:'+spc+%
+ 1e3*a#1.frcnt/(a#1.msEnd-a#1.msStart)+spc+'fps',%
+ nIcon:3%
+ });
+ };%
+ \fi%
+ \fi%
}%
\if@anim@step\else%
\if@anim@autoplay