diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/doc/animate.pdf | bin | 1321543 -> 1308016 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/doc/animate.tex | 109 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp | 20 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/animate/animate.sty | 156 |
5 files changed, 206 insertions, 81 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/README b/Master/texmf-dist/doc/latex/animate/README index e3cd6ac0081..1af31cea478 100644 --- a/Master/texmf-dist/doc/latex/animate/README +++ b/Master/texmf-dist/doc/latex/animate/README @@ -77,7 +77,7 @@ Usage: Requirements: - pdfeTeX, version >= 1.20 + pdfTeX, version >= 1.20 Ghostscript, version >= 8.31 or Adobe Distiller Adobe Reader, version >= 6 diff --git a/Master/texmf-dist/doc/latex/animate/doc/animate.pdf b/Master/texmf-dist/doc/latex/animate/doc/animate.pdf Binary files differindex c0dd20c1155..ad0fe39cea0 100644 --- a/Master/texmf-dist/doc/latex/animate/doc/animate.pdf +++ b/Master/texmf-dist/doc/latex/animate/doc/animate.pdf diff --git a/Master/texmf-dist/doc/latex/animate/doc/animate.tex b/Master/texmf-dist/doc/latex/animate/doc/animate.tex index 0477da2d1ad..794d4a5faa7 100644 --- a/Master/texmf-dist/doc/latex/animate/doc/animate.tex +++ b/Master/texmf-dist/doc/latex/animate/doc/animate.tex @@ -73,9 +73,9 @@ The `animate' package makes use of Optional Content Groups (OCG), also known as \section{Requirements} \begin{trivlist} -\item pdf$\varepsilon$\TeX{}, version $\ge1.20$ for direct PDF output +\item pdf\TeX{}, version $\ge1.20$ for direct PDF output \item Ghostscript, version $\ge8.31$ or Adobe Distiller for PS to PDF conversion -\item Adobe Reader, version $\ge6$ +\item Adobe Reader, version $\ge6$, but not $8.0$ and $8.1$ \end{trivlist} \section{Installation} @@ -126,7 +126,7 @@ and the environment While \verb+\animategraphics+ can be used to assemble animations from sets of existing graphics files, the environment `\verb+animateinline+' is meant to create the animation from the typeset material it encloses. This material can be pictures drawn within the \LaTeX{} `\verb+picture+' environment or using the advanced capabilities of PSTricks or pgf/TikZ. Even ordinary textual material may be animated in this way. The parameter \verb+<frame rate>+ specifies the number of frames per second of the animation. -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 below). +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}). 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. @@ -136,7 +136,9 @@ There is no file name extension to be specified as a parameter. The possible fil For example, given the sequence `frame\_5.png' through `frame\_19.png' from a possibly larger set that shall be used to build the animation. Then, {\tt <file base\-name>} would be specified as `\verb+frame_+', \verb+<first>+ as `\verb+5+' and \verb+<last>+ as `\verb+19+'. +\section{Command options} The following options to \verb+\animategraphics+ and `\verb+animateinline+' have been provided: +\subsection{Basic options} \begin{verbatim} poster[=first | none | last] \end{verbatim} @@ -191,7 +193,7 @@ Changes the control button height to \verb+<size>+, which must be a valid \TeX{} buttonbg=<colour> buttonfg=<colour> \end{verbatim} -By default, control button widgets are drawn with black strokes on transparent background. The background can be turned into a solid colour by the first option, while the second option specifies the stroke colour. The parameter \verb+<colour>+ is an array of colon-(`\verb+:+')-separated numbers in the range from 0.0 to 1.0. The number of array elements determines the colour model in which the colour is defined: (1) gray value, (3) RGB, (4) CMYK. For example, `\verb+1+', `\verb+1:0.5:0.2+' and `\verb+0.5:0.3:0.7:0.1+' are valid colour specifications. +By default, control button widgets are drawn with black strokes on transparent background. The background can be turned into a solid colour by the first option, while the second option specifies the stroke colour. The parameter \verb+<colour>+ is an array of colon-(\verb+:+)-separated numbers in the range from 0.0 to 1.0. The number of array elements determines the colour model in which the colour is defined: (1) gray value, (3) RGB, (4) CMYK. For example, `\verb+1+', `\verb+1:0.5:0.2+' and `\verb+0.5:0.3:0.7:0.1+' are valid colour specifications. \begin{verbatim} draft final @@ -205,30 +207,33 @@ end={<end text>} \begin{verbatim} begin={\begin{pspicture}(...)(...)}, end={\end{pspicture}} \end{verbatim} + +\subsection{The `{\tt timeline}' option}\label{sect:timeline} \begin{verbatim} timeline=<timeline file> \end{verbatim} -\verb+<timeline file>+ is a plain text file whose contents determines the order of appearance of the embedded material during the animation. In addition, it allows to freely reorder, repeat and overlay the material at any point of the animation. This may greatly reduce the file size of the resulting PDF, as objects that do not change between several or all frames, such as coordinate axes or labels, can be embedded once and reused in other frames of the animation. +\verb+<timeline file>+ is a plain text file whose contents determines the order of appearance of the embedded material during the animation. In addition, it allows to freely reorder, repeat and overlay the material at any point of the animation. This may greatly reduce the file size of the resulting PDF, as objects that do not change between several or all frames, such as coordinate axes or labels, can be embedded once and re-used in other frames of the animation. If a timeline is associated with the animation, the graphics files or inline graphics embedded by \verb+\animategraphics+ and `\verb+animateinline+' no longer represent the actual frames of the animation. Rather, they are a collection of \emph{transparencies} that can be played with at will. In order to identify the transparencies within the timeline file, they are numbered in the order of their inclusion, starting at zero. -Each line of the timeline file that is not blank and which does not begin with a comment (`\verb+%+') specifies \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+%+') specifies \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: \begin{verbatim} [*]:[<frame rate>]:[<frame content>] \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 like a \verb+\newframe*+ would do; a number in the second field changes the frame rate of the animation section that follows. (In connexion 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 single transparency specification obeys the syntax +An asterisk (`\verb+*+') in the leftmost field causes the animation to pause at that frame, very much like a \verb+\newframe*+ would do; a number in the second field changes the frame rate of the animation section that follows. (In connexion 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 \begin{verbatim} <transparency ID>[x<number of frames>] \end{verbatim} where \verb+<transparency ID>+ is an integer number that identifies the transparency to be drawn into the current animation frame. As pointed out above, the transparencies are consecutively numbered in the order of their inclusion, starting at zero. The optional postfix `\verb+x<number of frames>+' specifies the number of consecutive frames the transparency is to appear within. If omitted, a postfix of `\verb+x1+' is assumed, which causes the transparency to be shown in the current frame only. Obviously, \verb+<number of frames>+ must be a non-negative integer number. The meaning of postfix `\verb+x0+' is special; it causes the transparency to be shown in all frames, starting with the current one, until the end of the animation. -Note that the order in which transparency specifications appear in the timeline file determines their depth level. The animation may be thought of as a pile of transparencies. Transparencies are always put on top of that pile, possibly overdrawing objects that are on previously deposited transparencies. Once on the pile, each transparency remains at its place for the specified number of frames and is removed afterwards. That is, for a transparency to appear always on top it must be put to the rightmost end of each line in the timeline file. +Note that the order in which transparency specifications appear in the timeline file determines their \emph{depth} level. If a frame is composed of more than one transparency, transparency specifications on the left of the input line are closer to the background and will be overprinted by those on the right which are closer to the foreground. That is, the depth \emph{de}creases from left to right within \verb+<frame content>+. Also, if there are transparency specifications which span several frames (using postfix `\verb+x<number of frames>+'), they will be overprinted by transparency specifications that appear on subsequent lines in the timeline file. That is, the depth decreases in top-down direction within the timeline file. +%The animation may be thought of as a pile of transparencies. Transparencies are always put on top of that pile, possibly overdrawing objects that are on previously deposited transparencies. Once on the pile, each transparency remains at its place for the specified number of frames and is removed afterwards. That is, for a transparency to appear always on top it must be put to the rightmost end of each line in the timeline file. Consider the two timelines \begin{verbatim} - ::1,0 % zeroth transparency always on top + ::1,0 % zeroth transparency always in the foreground ::2,0 ::3,0 ::4,0 @@ -236,17 +241,35 @@ Consider the two timelines \end{verbatim} and \begin{verbatim} - ::0x0,1 % zeroth transparency in the lowest level + ::0x0,1 % zeroth transparency put to the background ::2 ::3 ::4 ... \end{verbatim} -In the first example, transparency No. `0' appears in the uppermost depth level throughout the animation; it will never be obscured by other transparencies' content. In the second example it is put on the lowest level (because it is the first transparency specification in the file) and stays there for the rest of the animation. +In the first example, transparency No. 0 appears in the foreground throughout the animation; it will never be obscured by other transparencies' content. In the second example it is put to the background, because it is the first transparency specification in the file, and stays there for the rest of the animation. + +\emph{Grouping objects into layers using `{\tt;}'} + +This 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: +\begin{verbatim} + ::0x49;2x0,3x0 + :: ;4x0,5x0 + :: ;6x0,7x0 + ... + :: ;98x0,99x0 + ::1x0;100x0,101x0 + :: ;102x0,103x0 + :: ;104x0,105x0 + ... +\end{verbatim} +In this timeline, the transparencies are grouped into two layers. One is reserved for the background images, transparencies No. 0 \& 1, that shall 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. 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 onwards. + +See the second animation in Section~\ref{sect:examples} for a working example that makes use of the timeline and the layer concept. \section{Examples} -\subsection[Animations from sets of files, using `animategraphics' command]{Animations from sets of files, using {\tt \string\animategraphics} command} -Animations in this section are made from graphics files that were prepared with \MP. Run `\verb+mpost+' on the files ending in `\verb+.mp+' in the `\verb+doc/files+' directory to generate the graphics files. Both examples make use of the `\verb+timeline+' option to reduce the resulting PDF file size. +\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+' 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. The first example, originally written by Jan Hole\v{c}ek~\cite{hol}, shows the exponential function $y=e^x$ and its approximation by Taylor polynomials of different degree. @@ -268,7 +291,7 @@ The first example, originally written by Jan Hole\v{c}ek~\cite{hol}, shows the e \end{document} \end{verbatim} \normalsize -Contents of file `\verb+timeline.txt+': +Contents of file `timeline.txt': \small \begin{verbatim} ::0x0 % coordinate system & y=e^x, repeated until last frame @@ -287,7 +310,7 @@ Contents of file `\verb+timeline.txt+': \animategraphics[controls,loop,timeline=timeline.txt]{4}{exp_}{0}{8} \end{center} -The second, somewhat more complex example animates the geometric construction of a scarabaeus. It 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 153 files, \verb+scarab_0.mps+ through \verb+scarab_152.mps+, is written out by running `\verb+mpost+' on the source file `\verb+scarab.mp+'. Files 0 through 100 contain the moving construction lines and the growing scarabaeus. Files 101 through 151 contain the gray lines which represent intermediate stages of the construction. The last file, No. 152, contains the coordinate axes, two stationary construction lines and the labels which do not move. Everything is overlaid by means of a timeline file that is written on-the-fly during the \LaTeX{} run to produce an animation of 101 individual frames. +The second, somewhat more complex example 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+' 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. \small \begin{verbatim} \documentclass{article} @@ -297,8 +320,10 @@ The second, somewhat more complex example animates the geometric construction of \newcounter{scarab} \setcounter{scarab}{0} +\newcounter{blueline} +\setcounter{blueline}{101} \newcounter{grayline} -\setcounter{grayline}{101} +\setcounter{grayline}{202} %write timeline file \newwrite\TimeLineFile @@ -306,12 +331,15 @@ The second, somewhat more complex example animates the geometric construction of \whiledo{\thescarab<101}{ \ifthenelse{\intcalcMod{\thescarab}{2}=0}{ %a gray line is added to every 2nd frame - \immediate\write\TimeLineFile{::\thegrayline x0,152,\thescarab} + \immediate\write\TimeLineFile{% + ::\thegrayline x0;253;\thescarab x0,\theblueline} \stepcounter{grayline} }{ - \immediate\write\TimeLineFile{::152,\thescarab} + \immediate\write\TimeLineFile{% + ::;253;\thescarab x0,\theblueline} } \stepcounter{scarab} + \stepcounter{blueline} } \immediate\closeout\TimeLineFile @@ -321,25 +349,28 @@ The second, somewhat more complex example animates the geometric construction of width=0.8\linewidth, controls, loop, timeline=\jobname.tln - ]{12}{scarab_}{0}{152} + ]{12}{scarab_}{0}{253} \end{center} \end{document} \end{verbatim} \newcounter{scarab} \setcounter{scarab}{0} +\newcounter{blueline} +\setcounter{blueline}{101} \newcounter{grayline} -\setcounter{grayline}{101} +\setcounter{grayline}{202} \newwrite\TimeLineFile \immediate\openout\TimeLineFile\jobname.tln \whiledo{\thescarab<101}{ - \ifthenelse{\intcalcMod{\thescarab}{2}=0}{% - \immediate\write\TimeLineFile{::\thegrayline x0,152,\thescarab} + \ifthenelse{\intcalcMod{\thescarab}{2}=0}{ + \immediate\write\TimeLineFile{::\thegrayline x0;253;\thescarab x0,\theblueline} \stepcounter{grayline} }{ - \immediate\write\TimeLineFile{::152,\thescarab} + \immediate\write\TimeLineFile{::;253;\thescarab x0,\theblueline} } \stepcounter{scarab} + \stepcounter{blueline} } \immediate\closeout\TimeLineFile @@ -349,7 +380,7 @@ The second, somewhat more complex example animates the geometric construction of controls, loop, timeline=\jobname.tln - ]{12}{scarab_}{0}{152} + ]{12}{scarab_}{0}{253} \end{center} \normalsize @@ -444,21 +475,21 @@ This is an inline graphics example adapted from \cite{gilg05}. \section{Bugs}\label{sect:bugs} \begin{itemize} - \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+\FPadd+ from package `{\tt fp}'. For example: + \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} -% declare loop counter -\newcounter{iter}% + +\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 + %initialize loop counter and `n' \setcounter{iter}{0}% - %define some variable, e. g. `\somevar' - \FPset{\somevar}{1.0}% - %make copy `\varcopy' of `\somevar' with global scope - \xdef\varcopy{\somevar}% + \FPset{n}{nInit}% ... - ... create first frame using \somevar(=1.0) + ... create first frame using `\n' (Mind the backslash!) ... (\multido _can_ be used here!) ... \whiledo{\theiter<50}{% another 50 frames @@ -466,12 +497,10 @@ This is an inline graphics example adapted from \cite{gilg05}. \newframe% %increment loop counter by 1 \stepcounter{iter}% - %increment \somevar by, e. g., 0.5 - \FPadd{\somevar}{\varcopy}{0.5}% - %refresh the copy - \xdef\varcopy{\somevar}% + %calculate new value of `n' + \FPeval{n}{nInit+nIncr*\theiter}% ... - ... create frame using \somevar + ... create frame using `\n' ... (\multido _can_ be used here!) ... } @@ -481,9 +510,9 @@ This is an inline graphics example adapted from \cite{gilg05}. \item The maximum frame rate that can actually be achieved largely depends on the complexity of the graphics and on the available hardware. - \item The Adobe Reader setting `Use page cache' (menu `Preferences'$\rightarrow$`Startup') should be \emph{dis}abled. + \item The Adobe Reader setting `Use page cache' (menu `Edit' $\rightarrow$ `Preferences' $\rightarrow$ `Startup') should be \emph{dis}abled. - \item The \verb+dvips+ option `\verb+-Ppdf+' should be avoided entirely or followed by something like `\verb+-X 2400 -Y 2400+' on the command line in order to set a sensible DVI resolution. In times of Type-1 fonts, this does \emph{not} degrade the output quality! The configuration file `\verb+config.pdf+' loaded by option `\verb+-Ppdf+' specifies an excessively high DVI resolution that will be passed on to the final PDF. Eventually, Adobe Reader gets confused and will not display the frames within the animation widget. + \item The \verb+dvips+ option `\verb+-Ppdf+' should be avoided entirely or followed by something like `\verb+-X 2400 -Y 2400+' on the command line in order to set a sensible DVI resolution. In times of Type-1 fonts, this does \emph{not} degrade the output quality! The configuration file `config.pdf' loaded by option `\verb+-Ppdf+' specifies an excessively high DVI resolution that will be passed on to the final PDF. Eventually, Adobe Reader gets confused and will not display the frames within the animation widget. \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. 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 8a74b530cc0..0d4dcb69039 100644 --- a/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp +++ b/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp @@ -8,7 +8,6 @@ verbatimtex \documentclass{article} \usepackage[latin1]{inputenc} \usepackage{amsmath} -%\usepackage[mdugm]{mathdesign} \begin{document} etex @@ -24,7 +23,7 @@ vardef proj(expr P,M,N)= enddef; path dr,cercle,drb,scara; -pair A,B,C,D,Q,T,O',P,O,M,M',N; +pair A,B,C,D,Q,T,O',P,O,M,N; O:=(0,0); O':=(-u/3,0); A:=(u/sqrt(2),u/sqrt(2)) shifted O' ; @@ -40,8 +39,9 @@ for i:=0 upto 100: P:=A; Q:=O'; M:=proj(O,P,Q); - scara:=M; + scara:=M; else: + scara:=M; for j:=1 upto 4: k:=4*(i-1)+j; if (k<200) or (k=200): @@ -72,7 +72,15 @@ for i:=0 upto 100: scara:=scara--M; endfor; fi; - beginfig(i) %scarabaeus + beginfig(i) %red scarabaeus segments + setbounds currentpicture to + (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle; + pickup pencircle scaled 1pt; + draw scara withcolor red; + clip currentpicture to + (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle; + endfig; + beginfig(i+101) %moving construction lines and labels setbounds currentpicture to (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle; draw 12[P,Q]--12[Q,P] dashed evenly; @@ -89,7 +97,7 @@ for i:=0 upto 100: (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle; endfig; if (i/2.-floor(i/2.))=0: %gray lines every second image - beginfig(i/2+101) + beginfig(i/2+202) setbounds currentpicture to (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle; draw P--Q withcolor 0.8 white; @@ -100,7 +108,7 @@ for i:=0 upto 100: endfor; %coordinate axes and stationary stuff -beginfig(152); +beginfig(253); setbounds currentpicture to (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle; path ida,mida; diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty index 28ae8abb784..209611cebf2 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}[2007/11/12] +\ProvidesPackage{animate}[2007/11/23] \RequirePackage{keyval} \RequirePackage{ifthen} \RequirePackage{ifpdf} @@ -59,7 +59,7 @@ \ifpdf \ifnum\pdftexversion<120 \PackageError{animate}{% - pdfeTeX, version >= 1.20, required% + pdfTeX, version >= 1.20, required% }{% Install a newer version!% }% @@ -75,7 +75,11 @@ %creating and using global definitions \def\@anim@newkey#1#2{{\expandafter\xdef\csname#1\endcsname{#2}}} -\def\@anim@getkeyval#1{\csname#1\endcsname} +\def\@anim@getkeyval#1{% + \expandafter\ifx\csname#1\endcsname\relax\else% + \csname#1\endcsname% + \fi% +} %missing package error message \def\@anim@missing#1{% @@ -200,7 +204,7 @@ \immediate\pdfxform\@anim@box% \xdef\@anim@lastxform{\the\pdflastxform}% \if@anim@timeline% - %keep record of XObject number + %keep a record of XObject number \@anim@newkey{img@#2}{\@anim@lastxform\space 0 R}% \else% \xdef\@anim@xobject{%XObject resource entry of container XObject @@ -427,7 +431,7 @@ } \fi -%create container XObjects for play & pause button faces; +%create container XObjects for play & pause button faces \ifpdf \def\@anim@makeppcontainer#1#2#3{% #1: @anim@num, #2: Right or Left, % #3: index of existing button face colour combination @@ -1557,7 +1561,7 @@ %prints zero padded integers % #1: arbitrary integer number as template specifying the % width, e. g. `987654' for a width of 6 digits -% #2: the number to be formatted (zero padded) +% #2: the number to be formatted \def\@anim@pad#1#2{% \@anim@@pad{\@anim@template{0}{#1}}{#2}% } @@ -1584,6 +1588,9 @@ %building timeline from timeline file \newread\@anim@@tmlnfile \newboolean{@anim@eof} +\newcount\@anim@tmpcnt %scratch counter for different uses +\newcount\@anim@curlayer %takes the number of the current layer being processed + \def\@anim@buildtmln#1{% #1:@anim@num \endlinechar=-1% suppress trailing space at input line end \global\@anim@curframe@zb=0% @@ -1609,9 +1616,10 @@ \setboolean{@anim@eof}{false}\fi% }% \closein\@anim@@tmlnfile% - \xdef\@anim@transp{\@anim@frames}% total number of transp + \xdef\@anim@transp{\@anim@frames}% total number of transparencies \xdef\@anim@frames{\the\@anim@curframe@zb}%total number of actual frames \global\@anim@curframe@zb=0% + \gdef\@anim@maxlayer{0}% highest layer index %reopen timeline file and build timeline \openin\@anim@@tmlnfile=\@anim@tmlnfile% \read\@anim@@tmlnfile to \@anim@inputline% @@ -1621,8 +1629,25 @@ \setboolean{@anim@eof}{false}\fi% \whiledo{\NOT\boolean{@anim@eof}}{% \ifthenelse{\equal{\@anim@inputline}{}}{}{% - \expandafter\@anim@parseline\@anim@inputline;% + %process input line + \expandafter\@anim@parseline\@anim@inputline\@nil% + %combine the layers of the current frame + \@anim@curlayer=0% + \loop\ifnum\@anim@curlayer>\@anim@maxlayer\else% + \@anim@newkey{frmcontent@\the\@anim@curframe@zb}{% + \@anim@getkeyval{frmcontent@\the\@anim@curframe@zb}% + \@anim@getkeyval{% + layercontent@\the\@anim@curframe@zb.\the\@anim@curlayer}% + }% + \@anim@newkey{% + layercontent@\the\@anim@curframe@zb.\the\@anim@curlayer}{}% + \advance\@anim@curlayer by \@ne% + \repeat% + %build frame xobject \@anim@makeframe{#1}{\the\@anim@curframe@zb}% + %clean-up + \edef\@anim@usedlist{\@anim@getkeyval{usedin@\the\@anim@curframe@zb}}% + \expandafter\@anim@resetusedlist\@anim@usedlist,:\@nil% \@anim@newkey{frmxobject@\the\@anim@curframe@zb}{}% \@anim@newkey{frmcontent@\the\@anim@curframe@zb}{}% \global\advance\@anim@curframe@zb by \@ne% @@ -1637,9 +1662,9 @@ } %reads one line of timeline file and splits into its colon separated parts -\def\@anim@parseline#1:#2:#3;{% +\def\@anim@parseline#1:#2:#3\@nil{% \if@anim@step\else% - \ifthenelse{\equal{#1}{*}}{%first column is a star (pause frame) + \ifthenelse{\equal{#1}{*}}{%first field is a star (pause frame) \xdef\@anim@pauseat{% \@anim@pauseat% a\the\@anim@num.pauseAt[\the\@anim@curframe@zb]=1;% @@ -1667,25 +1692,38 @@ \setboolean{@anim@chfps}{true}% change fps \fi% \fi% - %parse the third column - \@anim@parsethird#3,:;% + %parse the third field (list of layer specifications) + \global\@anim@curlayer=0 + \@anim@parsethird#3;:\@nil% } -%parses 3rd column of timeline file (comma separated list of transp. specs) -\def\@anim@parsethird#1,#2;{% - \ifthenelse{\equal{#1}{}}{}{\@anim@process#1x:;}%process one transparency spec - \ifthenelse{\equal{#2}{:}}{}{\@anim@parsethird#2;}% +%parses frame contents specification (semicolon separated list of layer +%specifications) +\def\@anim@parsethird#1;#2\@nil{% + \ifthenelse{\equal{#1}{}}{}{\@anim@parselayer#1,:\@nil}%process one layer spec + \ifthenelse{\equal{#2}{:}}{}{% + \global\advance\@anim@curlayer by \@ne% + \ifnum\@anim@curlayer>\@anim@maxlayer + \xdef\@anim@maxlayer{\the\@anim@curlayer}% + \fi% + \@anim@parsethird#2\@nil% + }% } -\newcount\@anim@tmpcnt %scratch counter for different uses +%parses contents of one layer specification (comma separated list of transp. +%specs) +\def\@anim@parselayer#1,#2\@nil{% + \ifthenelse{\equal{#1}{}}{}{\@anim@process#1x:\@nil}%process one transp spec + \ifthenelse{\equal{#2}{:}}{}{\@anim@parselayer#2\@nil}% +} %process transparency spec, such as 123 or 456x78 or 9x0 -\def\@anim@process#1x#2;{% +\def\@anim@process#1x#2\@nil{% %determine number of repetitions of current transparency \ifthenelse{\equal{#2}{:}}{% \gdef\@anim@repeats{1}% }{% - \@anim@processsecond#2;% + \@anim@getrepetitions#2\@nil% }% \ifnum\@anim@repeats=0 %0= means: repeat until end of timeline \edef\@anim@repeatuntil{\@anim@frames}% @@ -1698,18 +1736,57 @@ \edef\@anim@repeatuntil{\the\@anim@tmpcnt}% \fi% \fi% - %build contents and xobject resource list of animation frames according to - %transparency specifications + %build contents of animation layer and update frame xobject resource list + %according to transparency specifications \ifnum\@anim@transp<#1\else%ignore non-existing transparencies \ifnum\@anim@transp=#1\else% \@anim@tmpcnt=\@anim@curframe@zb% \loop\ifnum\@anim@repeatuntil>\@anim@tmpcnt - \@anim@newkey{frmxobject@\the\@anim@tmpcnt}{% - \@anim@getkeyval{frmxobject@\the\@anim@tmpcnt}\space% - /im#1\space\@anim@getkeyval{img@#1}% - }% - \@anim@newkey{frmcontent@\the\@anim@tmpcnt}{% - \@anim@getkeyval{frmcontent@\the\@anim@tmpcnt} q /im#1\space Do Q% + %detect multiple inclusion of the same transparency in the + %current frame + \expandafter\ifx\csname used@#1@\the\@anim@tmpcnt\endcsname\relax% + %append transparency to ressource list + \@anim@newkey{frmxobject@\the\@anim@tmpcnt}{% + \@anim@getkeyval{frmxobject@\the\@anim@tmpcnt}\space% + /im#1\space\@anim@getkeyval{img@#1}% + }% + %mark current transparency as used within the current frame + \@anim@newkey{used@#1@\the\@anim@tmpcnt}{}% + %append it to the list of transparencies used in current frame + \@anim@newkey{usedin@\the\@anim@tmpcnt}{% + \@anim@getkeyval{usedin@\the\@anim@tmpcnt}#1,}% + \else% + \PackageWarning{animate}{% + Transparency #1 multiply included in frame \the\@anim@tmpcnt.% + \MessageBreak% + File \jobname.tex% + }% + \ifx\@anim@warned\@undefined% + \AtEndDocument{% + \PackageWarningNoLine{animate}{% + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% + \MessageBreak% + @ In certain animation frames, transparencies were% + \space\space @\MessageBreak% + @ multiply included. This may considerably slow\space% + \space\space\space\space @\MessageBreak% + @ down animation speed. Revise the timeline file of\space @% + \MessageBreak% + @ the corresponding animations! See the transcript\space% + \space @\MessageBreak% + @ file \jobname.log\MessageBreak% + @ for additional information!\space\space\space\space\space% + \space\space\space\space\space\space\space\space\space\space% + \space\space\space\space\space\space\space\space @\MessageBreak% + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% + }% + }% + \gdef\@anim@warned{}% + \fi% + \fi% + \@anim@newkey{layercontent@\the\@anim@tmpcnt.\the\@anim@curlayer}{% + \@anim@getkeyval{layercontent@\the\@anim@tmpcnt.\the\@anim@curlayer} + q /im#1\space Do Q% }% \advance\@anim@tmpcnt by \@ne% \repeat% @@ -1717,8 +1794,19 @@ \fi% } +%reset embedded transparency list +\def\@anim@resetusedlist#1,#2\@nil{% + \ifthenelse{\equal{#1}{}}{}{% + \expandafter\global\expandafter\let\csname + used@#1@\the\@anim@curframe@zb\endcsname\@undefined% + }% + \ifthenelse{\equal{#2}{:}}{% + \@anim@newkey{usedin@\the\@anim@curframe@zb}{}% + }{\@anim@resetusedlist#2\@nil}% +} + %get number of repetitions of frame -\def\@anim@processsecond#1x:;{% +\def\@anim@getrepetitions#1x:\@nil{% \gdef\@anim@repeats{#1}% } @@ -1742,11 +1830,11 @@ \define@key{anim@user}{buttonsize}{% \gdef\@anim@btnsize{#1}% } -\def\@anim@colours#1:#2;{% helper macro to get number of colour components and +\def\@anim@colours#1:#2\@nil{% helper macro to get number of colour components and \xdef\@anim@colour{\@anim@colour\space #1}% to replace : by ` ' in the arg \ifthenelse{\equal{#2}{!}}{}{% \global\advance\@anim@tmpcnt by \@ne% - \@anim@colours#2;% + \@anim@colours#2\@nil% }% } \ifpdf %background frame of buttons @@ -1769,7 +1857,7 @@ \define@key{anim@user}{buttonbg}{%background colour of buttons \global\@anim@tmpcnt=\@ne% \gdef\@anim@colour{}% - \@anim@colours#1:!;% + \@anim@colours#1:!\@nil% \xdef\@anim@bgcolour{\@anim@colour}% \ifpdf% \ifnum\@anim@tmpcnt=\@ne @@ -1800,7 +1888,7 @@ \define@key{anim@user}{buttonfg}{%stroking colour of buttons \global\@anim@tmpcnt=\@ne% \gdef\@anim@colour{}% - \@anim@colours#1:!;% + \@anim@colours#1:!\@nil% \xdef\@anim@fgcolour{\@anim@colour}% \ifpdf% \ifthenelse{\the\@anim@tmpcnt=\@ne}{% @@ -1957,7 +2045,7 @@ \define@key{anim@pkg}{buttonbg}{%background colour of buttons \global\@anim@tmpcnt=\@ne% \gdef\@anim@colour{}% - \@anim@colours#1:!;% + \@anim@colours#1:!\@nil% \xdef\@anim@@bgcolour{\@anim@colour}% \ifpdf% \ifnum\@anim@tmpcnt=\@ne @@ -1990,7 +2078,7 @@ \define@key{anim@pkg}{buttonfg}{%stroking colour of buttons \global\@anim@tmpcnt=\@ne% \gdef\@anim@colour{}% - \@anim@colours#1:!;% + \@anim@colours#1:!\@nil% \xdef\@anim@@fgcolour{\@anim@colour}% \ifpdf% \ifthenelse{\the\@anim@tmpcnt=\@ne}{% |