diff options
author | Karl Berry <karl@freefriends.org> | 2008-03-08 17:37:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-03-08 17:37:09 +0000 |
commit | 2f22084ef856c7992c473c4ff3b5723fbd66d181 (patch) | |
tree | faa3a4fbad14a230091cc9698d566dd2003f186b /Master/texmf-dist | |
parent | c33c52f5267b5241fb4ca934a55a316869ace447 (diff) |
animate update (6mar08)
git-svn-id: svn://tug.org/texlive/trunk@6891 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/README | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/doc/animate.pdf | bin | 1315467 -> 1312926 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/doc/animate.tex | 85 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/animate/animate.sty | 42 |
5 files changed, 100 insertions, 39 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/README b/Master/texmf-dist/doc/latex/animate/README index 0c7ccb12224..47ea71bba1d 100644 --- a/Master/texmf-dist/doc/latex/animate/README +++ b/Master/texmf-dist/doc/latex/animate/README @@ -41,10 +41,10 @@ Description: command options. Please refer to the documentation `animate.pdf' in the `doc/' directory for details and examples. - Keywords: include, portable, PDF, animation, animating, embed, animated, - graphics, LaTeX, pdfLaTeX, animated GIF, PSTricks, pgf, TikZ, - MetaPost, LaTeX-picture, inline graphics, vector graphics, dvips, - ps2pdf, JavaScript, Adobe Reader + Keywords: include portable PDF animation animating embed animated graphics + LaTeX pdfLaTeX PSTricks pgf TikZ MetaPost LaTeX-picture inline + graphics vector graphics animated GIF LaTeX dvips ps2pdf + JavaScript Adobe Reader Usage: @@ -81,7 +81,7 @@ Requirements: pdfTeX, version >= 1.20 Ghostscript, version >= 8.31 or Adobe Distiller - Adobe Reader, version >= 6, but not 8.0 and 8.1 + Adobe Reader, version >= 6, but not 8 Installation: 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 6346bdeb512..1220a360889 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 12167460243..259c1851b18 100644 --- a/Master/texmf-dist/doc/latex/animate/doc/animate.tex +++ b/Master/texmf-dist/doc/latex/animate/doc/animate.tex @@ -1,4 +1,4 @@ -% Copyright 2007 Alexander Grahn +% Copyright 2007--2008 Alexander Grahn % % This material is subject to the LaTeX Project Public License. See % http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html @@ -21,13 +21,17 @@ \usepackage{ifpdf} \usepackage{parskip} +\makeatletter +\renewcommand{\fnum@figure}[1]{\figurename~\thefigure} +\makeatother + \ifpdf \makeatletter \@latex@error{Please use LaTeX to compile this documentation} \makeatother \fi -\def\keywords{include, portable, PDF, animation, animating, embed, animated, graphics, LaTeX, pdfLaTeX, animated GIF, PSTricks, pgf, TikZ, LaTeX-picture, MetaPost, inline graphics, vector graphics, dvips, ps2pdf, JavaScript, Adobe Reader} +\def\keywords{include portable PDF animation animating embed animated graphics LaTeX pdfLaTeX PSTricks pgf TikZ LaTeX-picture MetaPost inline graphics vector graphics animated GIF LaTeX dvips ps2pdf JavaScript Adobe Reader} \hypersetup{ bookmarksnumbered,linktocpage,breaklinks, pdftitle={The animate Package}, @@ -67,7 +71,7 @@ Package `animate' supports the usual PDF making workflows, i.\,e. pdf\LaTeX{} an The final PDF can be viewed in current Adobe Reader\textsuperscript{\scriptsize\textregistered}s on all supported platforms. -The `animate' package makes use of Optional Content Groups (OCG), also known as PDF layers, which is a feature provided by the PDF-1.5 specification. Each frame of an animation is associated with an OCG that is hidden or made visible in a dynamic fashion by means of Adobe Reader's built-in JavaScript engine. +The `animate' package relies on Optional Content Groups (OCG), also known as PDF layers, which is a feature provided by the PDF-1.5 specification. Each frame of an animation is associated with an OCG that is hidden or made visible in a dynamic fashion by means of Adobe Reader's built-in JavaScript engine. \section{Requirements} \begin{trivlist} @@ -102,7 +106,7 @@ buttonfg=<colour> step poster[=first | none | last] \end{verbatim} -The same options are also available (among others) 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. +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. @@ -129,7 +133,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] -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$. +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. @@ -245,7 +249,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 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 +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 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} @@ -291,9 +295,9 @@ See the second animation in Section~\ref{sect:examples} for a working example th \section{Examples} \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. +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. -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. +The first example, Fig.~\ref{fig:taylor}, 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. \small \begin{verbatim} @@ -328,11 +332,13 @@ Contents of file `timeline.txt': \end{verbatim} \normalsize -\begin{center} - \animategraphics[controls,loop,timeline=timeline.txt]{4}{exp_}{0}{8} -\end{center} +\begin{figure} +\centering +\animategraphics[controls,loop,timeline=timeline.txt]{4}{exp_}{0}{8} +\caption{}\label{fig:taylor} +\end{figure} -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. +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. \small \begin{verbatim} \documentclass{article} @@ -375,6 +381,8 @@ The second, somewhat more complex example animates the geometric construction of \end{center} \end{document} \end{verbatim} +\begin{figure} +\centering \newcounter{scarab} \setcounter{scarab}{0} \newcounter{blueline} @@ -396,18 +404,19 @@ The second, somewhat more complex example animates the geometric construction of } \immediate\closeout\TimeLineFile -\begin{center} - \animategraphics[ - width=0.8\linewidth, - controls, - loop, - timeline=\jobname.tln - ]{12}{scarab_}{0}{253} -\end{center} +\animategraphics[ + width=0.8\linewidth, + controls, + loop, + timeline=\jobname.tln +]{12}{scarab_}{0}{253} + +\caption{}\label{fig:scarab} +\end{figure} \normalsize \subsection[Animating PSTricks graphics, using `animateinline' environment]{Animating PSTricks graphics, using `{\tt animateinline}' environment} -This is an inline graphics example adapted from \cite{gilg05}. +Fig.~\ref{fig:torus} is an inline graphics example adapted from \cite{gilg05}. \small \begin{verbatim} \documentclass{article} @@ -459,6 +468,8 @@ This is an inline graphics example adapted from \cite{gilg05}. \end{verbatim} \normalsize +\begin{figure} +\centering \newcommand{\torus}[1]{% #1: angle of the torus sector \psset{Beta=20,Alpha=50,linewidth=0.1pt,origin={0,0,0},unit=0.35}% \begin{pspicture}(-12.3,-6.3)(12.3,7)% @@ -481,8 +492,6 @@ This is an inline graphics example adapted from \cite{gilg05}. \end{pspicture}% } - -\begin{center} \newcounter{torusangle} \setcounter{torusangle}{80} \begin{animateinline}[poster=last,controls,palindrome]{10}% @@ -493,7 +502,8 @@ This is an inline graphics example adapted from \cite{gilg05}. \torus{\thetorusangle}% } \end{animateinline}% -\end{center} +\caption{}\label{fig:torus} +\end{figure} \section{Bugs}\label{sect:bugs} \begin{itemize} @@ -538,7 +548,32 @@ This 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 Animations with complex graphics and/or many frames may cause \LaTeX{} to fail with a `\verb+TeX capacity exceeded+' error. Depending on the \TeX-system in use, enlarge \TeX{}'s memory with the \verb+(pdf)latex+ command line option `\verb+--mem-max=...+' or by increasing the value of `\verb+main_memory+' in the file `texmf.cnf'. (Changing `texmf.cnf' requires the format files to be rebuilt. Run `\verb+fmtutil-sys --all+'.) + \item Animations with complex graphics, many frames or complicated timelines may cause \LaTeX{} to fail with a `\verb+TeX capacity exceeded+' error. The following steps should fix most of the memory related problems. + + MiKTeX: + \begin{enumerate} + \item Open a command line window. + \item\label{item:firststep} At the DOS prompt, enter\\ + {\tt initexmf -{}-edit-config-file=latex} + \item Insert\\ + {\tt main\_memory=8000000}\\ + {\tt save\_size=80000}\\ + 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 entries `{\tt main\_memory}' \& `{\tt save\_size}' and change them to the values 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.) 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 bef95226e24..d17cf5b2926 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 d434237a8b3..7d1f0e770f4 100644 --- a/Master/texmf-dist/tex/latex/animate/animate.sty +++ b/Master/texmf-dist/tex/latex/animate/animate.sty @@ -1,4 +1,4 @@ -% Copyright 2007 Alexander Grahn +% Copyright 2007--2008 Alexander Grahn % This material is subject to the LaTeX Project Public License. See % http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html @@ -13,7 +13,7 @@ % Supports LaTeX->dvips->ps2pdf or pdfLaTeX workflows. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{animate}[2008/01/03] +\ProvidesPackage{animate}[2008/03/05] \RequirePackage{keyval} \RequirePackage{ifthen} \RequirePackage{ifpdf} @@ -100,8 +100,11 @@ }{}% } -%add OCProperties dict to Catalog +%add AcroForm and OCProperties entries to Catalog \ifpdf + \newcount\@anim@@fields + \pdfobj reserveobjnum + \@anim@@fields=\pdflastobj \newcount\@anim@@ocgs \pdfobj reserveobjnum \@anim@@ocgs=\pdflastobj @@ -109,15 +112,24 @@ \pdfobj reserveobjnum \@anim@@posterocgs=\pdflastobj \pdfcatalog{ + /AcroForm << + /Fields \the\@anim@@fields\space 0 R + >> /OCProperties << /OCGs \the\@anim@@ocgs\space 0 R - /D <</BaseState/OFF /ON \the\@anim@@posterocgs\space 0 R - /Order \the\@anim@@ocgs\space 0 R>> + /D << + /BaseState/OFF /ON \the\@anim@@posterocgs\space 0 R + /Order \the\@anim@@ocgs\space 0 R + >> >> } + \def\@anim@fields{} \def\@anim@ocgs{} \def\@anim@posterocgs{} \AtEndDocument{% + \immediate\pdfobj useobjnum \@anim@@fields {% + [\@anim@fields]% + }% \immediate\pdfobj useobjnum \@anim@@ocgs {% [\@anim@ocgs]% }% @@ -126,12 +138,19 @@ }% }% \else + % counts inserted interactive fields (widget annots) + \newcount\@anim@fieldnum\@anim@fieldnum=0 \special{ps: + % array which takes refs to all widget annotations + mark /_objdef {@anim@fields} /type/array /OBJ pdfmark % array which takes all ocgs (one per animation frame) mark /_objdef {@anim@ocgs} /type/array /OBJ pdfmark % array which takes ocgs shown by default (the poster frames) mark /_objdef {@anim@posterocgs} /type/array /OBJ pdfmark mark {Catalog} << + /AcroForm << + /Fields {@anim@fields} + >> /OCProperties << /OCGs {@anim@ocgs} /D <</BaseState/OFF /ON {@anim@posterocgs} /Order {@anim@ocgs}>> @@ -144,9 +163,9 @@ \newdimen\@anim@tmpdima %length registers for occasional use \newdimen\@anim@tmpdimb -%tests whether file is known, if so it returns identifier of form xobj -%otherwise `!' -\def\@anim@fileknown#1#2{% #1 file name, #2 page No +%tests whether file is already known (and embedded), if so it returns identifier +%of xobj, otherwise returns `!' +\def\@anim@fileknown#1#2{% #1 file name, #2 page No. %identify file by md5sum \expandafter\ifx\csname file:\pdfmdfivesum file {#1}.#2\endcsname\relax!% \else\@anim@getkeyval{file:\pdfmdfivesum file {#1}.#2}\fi% @@ -1265,6 +1284,7 @@ \@anim@otherjscriptkey% >>% }% + \xdef\@anim@fields{\@anim@fields\space\the\pdflastannot\space 0 R}% \hbox to \@anim@animwidth\p@ {% \vrule width 0pt height \@anim@animheight\p@ depth \@anim@animdepth\p@% \hss% @@ -1297,6 +1317,7 @@ \fi \special{ps: mark + /_objdef {annot@\the\@anim@fieldnum}% /Rect [wid@llx wid@lly wid@urx wid@ury]% /Subtype/Widget% /F 4% @@ -1310,7 +1331,9 @@ \@anim@otherjscriptkey% >>% /ANN pdfmark + mark {@anim@fields} {annot@\the\@anim@fieldnum} /APPEND pdfmark }% + \global\advance\@anim@fieldnum by \@ne% \hbox to \@anim@animwidth\p@ {% \vrule width 0pt height \@anim@animheight\p@ depth \@anim@animdepth\p@% \hss% @@ -1338,6 +1361,7 @@ /T (btn@#1@#2)% /A <</S/JavaScript/JS (\@anim@upjscriptstring)>>% }% + \xdef\@anim@fields{\@anim@fields\space\the\pdflastannot\space 0 R}% \vrule width 0pt height \@anim@tmpdima depth 0pt% \hss% }% @@ -1370,7 +1394,9 @@ /T (btn@#1@#2)% /A <</S/JavaScript/JS (\@anim@upjscriptstring)>>% /ANN pdfmark + mark {@anim@fields} {annot@\the\@anim@fieldnum} /APPEND pdfmark }% + \global\advance\@anim@fieldnum by \@ne% \hbox to \the\@anim@tmpdima {% \vrule width 0pt height \the\@anim@tmpdima\space depth 0pt% \hss% |