diff options
author | Karl Berry <karl@freefriends.org> | 2024-09-17 19:54:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-09-17 19:54:14 +0000 |
commit | 58e091f5a742696075af00eb7d9cfc0ec2a4d677 (patch) | |
tree | 946208031c4ed2b50082f2eb988f03fb8f974a0a | |
parent | 6a089818725e4993d3a4a0ed17672ecac45f4a29 (diff) |
animate (17sep24)
git-svn-id: svn://tug.org/texlive/trunk@72304 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/ChangeLog | 14 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/README.txt | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/animate/animate.pdf | bin | 3793353 -> 3797724 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/animate/animate.tex | 51 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/animate/animate.sty | 5 |
5 files changed, 47 insertions, 28 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/ChangeLog b/Master/texmf-dist/doc/latex/animate/ChangeLog index 969f6399c6a..4faf3429d77 100644 --- a/Master/texmf-dist/doc/latex/animate/ChangeLog +++ b/Master/texmf-dist/doc/latex/animate/ChangeLog @@ -1,3 +1,7 @@ +2024-09-17 + * change: `method=widget' now default for extended range of supporting viewers + * fix: documentation revised + 2024-09-06 * fix: documentation PDF re-compiled and minor README additions @@ -57,10 +61,10 @@ * fix: pausing on the 0th frame 2020-08-29 - * new: \multiframebreak for terminating \multiframe loop + * new: \multiframebreak for terminating \multiframe loop 2020-08-04 - * fix: typesetting failure with `latex-dev' + * fix: typesetting failure with `latex-dev' 2020-05-29 * fix: `autoplay' option non-functional in combination with `poster=last'; @@ -231,12 +235,12 @@ * fix: bug related to XObject referencing 2016-03-11 - * new: now uses pdfbase.sty for low level PDF operations + * new: now uses pdfbase.sty for low level PDF operations 2016-02-28 * Fix: workaround for bug http://tex.stackexchange.com/q/295715 : different behaviour of AR versions with regard to PageOpen and PageVisible events - where animation initialisation takes place + where animation initialisation takes place 2016-02-15 * Fix: bug http://tex.stackexchange.com/q/292805 @@ -454,7 +458,7 @@ * New: the transparency stack can now be cleared using `c' in the timeline file * improved documentation of the timeline option - * New animateinline example (Lorenz Attractor) + * New animateinline example (Lorenz Attractor) * Fix: animfp.sty: trailing zeros are now removed from the fractional part of the result of the addition of two reals diff --git a/Master/texmf-dist/doc/latex/animate/README.txt b/Master/texmf-dist/doc/latex/animate/README.txt index 71718825ac8..a6c8c749519 100644 --- a/Master/texmf-dist/doc/latex/animate/README.txt +++ b/Master/texmf-dist/doc/latex/animate/README.txt @@ -20,9 +20,8 @@ It supports the usual PDF making workflows, i. e. pdfLaTeX, LaTeX -> dvips LaTeX -> dvisvgm for SVG. The resulting PDF with animations can be viewed in Acrobat Reader (except on -mobile devices), KDE Okular, PDF-XChange, Foxit Reader, PDF.js (PDF viewer in -Firefox). For compatibility with PDF.js, animations must be built with option -`method=widget'. +mobile devices), KDE Okular, PDF-XChange, Foxit Reader, PDF.js (Firefox' +built-in PDF viewer and extension for Chromium-based browsers). Animated SVG are self-contained files that can be embedded into HTML using the `<object>' tag or opened directly in a Web browser, such as Firefox or diff --git a/Master/texmf-dist/doc/latex/animate/animate.pdf b/Master/texmf-dist/doc/latex/animate/animate.pdf Binary files differindex d74cbc45156..a117175261c 100644 --- a/Master/texmf-dist/doc/latex/animate/animate.pdf +++ b/Master/texmf-dist/doc/latex/animate/animate.pdf diff --git a/Master/texmf-dist/source/latex/animate/animate.tex b/Master/texmf-dist/source/latex/animate/animate.tex index d3bab3850be..9cc30bf2eb3 100644 --- a/Master/texmf-dist/source/latex/animate/animate.tex +++ b/Master/texmf-dist/source/latex/animate/animate.tex @@ -18,7 +18,7 @@ %%%%%% /pdfmanagement-testphase %%%%%% \documentclass[a4paper]{article} \frenchspacing -\usepackage[buttonbg=0.9,method=widget]{animate} +\usepackage[buttonbg=0.9]{animate} \usepackage[UKenglish]{babel} \usepackage{pst-3dplot} \usepackage{pst-node,pst-plot,pst-tools,pst-text,pst-ode} @@ -94,7 +94,7 @@ \def\@anim@sanitizeColon{}\def\@anim@sanitizeJS{}\def\@anim@endsanitize{} \expandafter\parsedate\animVersion\relax %set current date to package date \makeatother -\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex,nomouse]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding.} \protect\footnote{Animation examples in this document have all been built with the `\texttt{method=widget}' option to make them work in PDF.js, Mozilla's PDF viewer built into the Firefox Web browser.}% +\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex,nomouse]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding.}% \protect\footnote{Animation examples in this document have all been built with the `\texttt{method=widget}' option to make them work in PDF.js, Mozilla's PDF viewer built into the Firefox Web browser.}% %\space\protect\footnote{Animations may run slowly if viewed in the Acrobat Reader browser plugin.}% \\[1ex]\url{https://gitlab.com/agrahn/animate}} \maketitle @@ -111,16 +111,32 @@ \tableofcontents %\newpage -\section{Introduction} +\section{Introduction}\label{sect:intro} This package provides an interface for creating PDF and SVG files with animated content from sets of graphics or image files, from inline graphics, such as \LaTeX-picture, PSTricks or pgf/TikZ generated pictures, or just from typeset text. Unlike standard movie/video formats, package `animate' allows for animating vector graphics. The result is roughly similar to the SWF (Flash) format, although not as space-efficient. Package `animate' supports the usual workflows for making PDF, i.\,e. pdf\LaTeX{}, Lua\-\LaTeX{}, \LaTeX{} $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+/Distiller and \pXepLaTeX{} $\rightarrow$ \verb+(x)dvipdfmx+. For animated SVG, it supports the \verb+dvisvgm+ driver. The DVI/XDV used as input for \verb+dvisvgm+ can be generated with \LaTeX{}, Lua\LaTeX{} (in DVI mode with command `\verb+dvilualatex+') and \XeLaTeX{} (with option `\verb+--no-pdf+'). -PDF files with animations can be viewed in Acrobat Reader (except on mobile devices), KDE Okular, PDF-XChange, Foxit Reader, PDF.js (as Firefox built-in PDF viewer, or in other Web browsers via URL). The most recent release of PDF.js can be accessed online in a Web browser (Firefox, Chromium, Chrome, Edge, ...) via the following URL: +PDF files with animations can be viewed in Acrobat Reader (except on mobile devices), KDE Okular, PDF-XChange, Foxit Reader, PDF.js (Firefox' built-in PDF viewer and extension for Chromium-based Web browsers). To view a local PDF file in the Web browser, open it by right-click in a file explorer or by starting the Web browser on the command-line, passing the PDF file name as its argument. The full-screen mode, also known as Presentation Mode in PDF.js, can be reached via the \raisebox{0.5\depth}{{\fboxsep=3pt\colorbox{lightgray}{\texttt{\large>>}}}} button at the right end of the toolbar. The PDF.js extension for Chromium/Chrome/Edge can be installed from -\url{https://mozilla.github.io/pdf.js/web/viewer.html?file=} +\makebox[\linewidth][l]{\href{https://chromewebstore.google.com/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm}{\nolinkurl{https://chromewebstore.google.com/detail/pdf-viewer/}}}\\ +\makebox[\linewidth][r]{\href{https://chromewebstore.google.com/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm}{\nolinkurl{oemmndcbldboiebfnladdacbdfmadadm}}} -Then, to open a local PDF file in PDF.js, click \raisebox{0.5\depth}{{\fboxsep=3pt\colorbox{lightgray}{\texttt{\large>>}}}} at the right end of its tool bar. In the `Tools' menu, click on `Open'. Note that option `\texttt{method=widget}' must be set to produce animations that are compatible with PDF.js. +For animations to play in the Chromium extension, JavaScript needs to be enabled in the settings: + +\makebox[\linewidth][l]{\url{chrome://extensions/?id=oemmndcbldboiebfnladdacbdfmadadm} $\rightarrow$}\\ +\makebox[\linewidth][r]{Extension options $\rightarrow$ Enable active content (JavaScript) in PDFs} + +Viewing of local files also needs to be enabled in Chromium-based browsers: + +\makebox[\linewidth][l]{\url{chrome://extensions/?id=oemmndcbldboiebfnladdacbdfmadadm} $\rightarrow$}\\ +\makebox[\linewidth][r]{Allow access to file URLs} + +%Note that option `\texttt{method=widget}' must be set to produce animations that are compatible with PDF.js. +%PDF files with animations can be viewed in Acrobat Reader (except on mobile devices), KDE Okular, PDF-XChange, Foxit Reader, PDF.js (as Firefox built-in PDF viewer, or in other Web browsers via URL). The most recent release of PDF.js can be accessed online in a Web browser (Firefox, Chromium, Chrome, Edge, ...) via the following URL: +% +%\url{https://mozilla.github.io/pdf.js/web/viewer.html?file=} +% +%Then, to open a local PDF file in PDF.js, click \raisebox{0.5\depth}{{\fboxsep=3pt\colorbox{lightgray}{\texttt{\large>>}}}} at the right end of its tool bar. In the `Tools' menu, click on `Open'. Note that option `\texttt{method=widget}' must be set to produce animations that are compatible with PDF.js. Animated SVG produced by means of \LaTeX{} and \verb+dvisvgm+ are self-sufficient files that can be embedded into HTML using the \verb+<object>+ tag or opened directly in a Web browser, such as Chromium or Firefox. Also, presentations, such as `beamer'-class documents, with embedded animations can be exported to SVG instead of PDF and viewed in a Web browser. SVG-capable Web browsers are standard on many platforms and operating systems and thus make SVG a very portable file format. A \LaTeX{} package for embedding video and audio into SVG is also available\cite{media4svg}. @@ -135,8 +151,7 @@ The user interacts with the animation through optional animation controls or usi \item pdf\TeX{}, version $\ge1.40$, or Lua\TeX{}, version $\ge0.95$, for direct PDF output \item Ghostscript, version $\ge9.15$, or Adobe Distiller for PS to PDF conversion \item \verb+dvipdfmx+ for DVI to PDF conversion -\item dvipdfmx, version $\ge 20190503$, for DVI to PDF conversion -\item \verb+dvisvgm+ for DVI to SVG conversion (also requires Ghostscript) +\item \verb+dvisvgm+ for DVI to SVG conversion (also requires Ghostscript and MuPDF) \item PDF: Acrobat Reader, KDE Okular, PDF-XChange, Foxit Reader, Firefox, version $\ge130$, PDF.js, version $\ge4.4.168$ \item SVG: Chromium-based browsers for best performance \end{trivlist} @@ -144,7 +159,7 @@ The user interacts with the animation through optional animation controls or usi \section{Installation} Unzip the file \href{http://mirrors.ctan.org/install/macros/latex/contrib/animate.tds.zip}{`animate.tds.zip'} into the local TDS root directory which can be found by running `\verb+kpsewhich -var-value TEXMFLOCAL+' on the command line. -After installation, update the filename database by running `\verb+texhash+' on the command line. +After installation, update the file name database by running `\verb+texhash+' on the command line. \TeX-Live and MiK\TeX{} users should run the package manager of their system for installation. @@ -392,11 +407,11 @@ With `\verb+draft+' the animation is not embedded. Instead, a box with the exact \begin{verbatim} nomouse \end{verbatim} -Animation widget will not respond to mouse clicks. Unless the JavaScript interface, Sect.~\ref{sect:api}, p.~\pageref{sect:api}, is used to control the animation, it is recommended to also set at least one of the `\verb+autoplay+' or `\verb+controls+' options. +Animation widget will not respond to mouse clicks. Unless the JavaScript interface, Section~\ref{sect:api}, p.~\pageref{sect:api}, is used to control the animation, it is recommended to also set at least one of the `\verb+autoplay+' or `\verb+controls+' options. \begin{verbatim} method=icon | widget | ocg \end{verbatim}\hypertarget{method}{}% -The package implements three different animation methods. The `\verb+icon+' method is the default method and usually gives the best performance in terms of animation frame rate. `\verb+widget+' and `\verb+ocg+' are alternative animation methods. Animations using the `\verb+widget+` method are supported in versions 4.4.168 and above of PDF.js, Mozilla's PDF viewer that ships as a built-in component of Firefox, but which can also be used with other Web browsers, such as Chrome or Chromium. The `\verb+ocg+' method may lead to a better animation performance than the other two in rare cases, such as standalone animations without animation controls. Moreover, `\verb+ocg+' allows an animation to be overlaid with other typeset material, that is, it can play in the page background. +The package implements three different animation methods. The `\verb+icon+' method usually gives the best performance in terms of animation frame rate in Acrobat Reader. However, the `\verb+widget+' method is now set by default because it extends the range of supporting viewers. Beginning with version 130, Firefox renders functional animations too. The PDF viewer bundled with Firefox, PDF.js, is also available as an extension for Chrome and releated browsers, see Section~\ref{sect:intro}. In rare cases, such as standalone animations without animation controls, the alternative `\verb+ocg+' method may lead to a better animation performance than the other two. Also, `\verb+ocg+' allows an animation to be overlaid with other typeset material, that is, it can play in the page background. However, support is limited to Acrobat Reader and Okular. \begin{verbatim} measure \end{verbatim} @@ -472,7 +487,7 @@ frame No. & timeline file & transparency stack\\\hline\hline \end{tabular} \end{table} -Figures~\ref{fig:taylor} and \ref{fig:lorenz} in Sect.~\ref{sect:examples} are animation examples with a single transparency stack. +Figures~\ref{fig:taylor} and \ref{fig:lorenz} in Section~\ref{sect:examples} are animation examples with a single transparency stack. \myparagraph*{Grouping objects into layers (= sub-stacks) using `{\tt;}'} Due to the stack-like nature of the animation, the position of a transparency specification in the timeline file determines its \emph{depth} level in relation to other transparencies. The timeline file is processed line by line and from left to right. In a single-stack animation, the stack is strictly built from the bottom up, such that earlier transparencies are overprinted by more recent ones. This may turn out to be inconvenient in certain situations. For example, it might be desirable to change 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 layers (sub-stacks) using the semicolon (\verb+;+) as a separator. New transparencies can now be put on top of the individual sub-stacks. After a line of the timeline file has been processed, the global stack is built by placing the sub-stacks on top of the other. Again, the left-to-right rule applies when determining the height of the sub-stacks in relation to each other within the global stack. @@ -509,7 +524,7 @@ frame No. & timeline file & transparency stack\\\hline\hline % %Note that \emph{without} setting up two layers, that is, by replacing the semicolons with commas, the foreground objects (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 Sect.~\ref{sect:examples} for a working example that makes use of the timeline and the layer concept. +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. \myparagraph*{Associate JavaScript actions with animation frames}\label{sect:jsfield} The optional fourth field \verb+<JavaScript>+ in a frame specification takes JavaScript code to be executed upon display of that frame. This could be used, for instance, to play a sound that was embedded using the `media9' \LaTeX{} package \cite{media9} or to execute JavaScript methods of the animation object. A non-trivial example is looping over a sub-range of frames which can be programmed by setting the `\verb+frameNum+' property of the animation object. See Section~\ref{sect:api} for details of the animation programming interface. @@ -605,7 +620,7 @@ Also, the programming interface can be used to create custom buttons for playbac ]{\fbox{Goto 6th frame}} \end{lstlisting} -\clearpage +%\clearpage \section{Examples} \subsection{Animations from sets of files, using {\tt\textbackslash animategraphics}}\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 `files' directory to generate the graphics files. Both examples make use of the `\verb+timeline+' option to reduce the resulting PDF file size. @@ -1379,7 +1394,7 @@ The following code may serve as a template for generating standalone animated SV % \end{document} \end{lstlisting} -Note that when animating external graphics with \verb+\animategraphics+, only PDF and PostScript (EPS, PS, MPS) files are converted to inline SVG code; files in other formats (SVG, PNG, JPEG) remain external and must be bundled with the final SVG output. Thus, for obtaining self-contained SVG, it is recommended to convert PNG, JPEG and SVG files to PDF or PostScript first. Also note that PostScript files must have all required fonts embedded. This is not always the case for \MP-generated PostScript. Here, embedding of fonts is ensured by putting `\verb+prologues := 3;+' into the header of the \MP{} input. +Note that when animating external graphics with \verb+\animategraphics+, only PDF and PostScript (EPS, PS, MPS) files are converted to inline SVG code; files in other formats (SVG, PNG, JPEG) remain external and must be bundled with the final SVG output. Thus, for obtaining self-contained SVG, it is recommended to convert PNG, JPEG and SVG files to PostScript or PDF first. Also note that PostScript files must have all required fonts embedded. This is not always the case for \MP-generated PostScript. Here, embedding of fonts is ensured by putting `\verb+prologues := 3;+' into the header of the \MP{} input. If PDF is chosen as file format for input graphics, the conversion utility `\verb+mutool+' must be present on the system. It is installed as part of the MuPDF (\url{https://mupdf.com}) package. Use one of \begin{verbatim} @@ -1473,7 +1488,7 @@ In \TeX4ht documents, the whole \verb+<object>...</object>+ tag can be inserted \item PDFs with animations cannot be embedded (via {\tt\string\includegraphics},\\ {\tt\string\includepdf}) into other documents as the animation capability gets lost. - \item Animations should not be placed on \emph{multilayered} slides, also known as overlays, created with presentation making classes such as Beamer or Powerdot. Those document classes turn overlays into separate PDF pages and re-insert the animation on every page thus produced. The animations are independent from each other and do not share the current playing state, such as frame number, playing speed and direction. Therefore, put animations on flat slides only; slides without animations may still have overlays, of course. On \href{https://tex.stackexchange.com/a/385209}{\TeX.SE}~\cite{texsx}, a method is suggested for placing an animation on a slide with overlays. It makes use of the programming interface introduced in Sect.~\ref{sect:api}, p.~\pageref{sect:api}. + \item Animations should not be placed on \emph{multilayered} slides, also known as overlays, created with presentation making classes such as Beamer or Powerdot. Those document classes turn overlays into separate PDF pages and re-insert the animation on every page thus produced. The animations are independent from each other and do not share the current playing state, such as frame number, playing speed and direction. Therefore, put animations on flat slides only; slides without animations may still have overlays, of course. On \href{https://tex.stackexchange.com/a/385209}{\TeX.SE}~\cite{texsx}, a method is suggested for placing an animation on a slide with overlays. It makes use of the programming interface introduced in Section~\ref{sect:api}, p.~\pageref{sect:api}. \end{itemize} \section{Acknowledgements} @@ -1481,14 +1496,14 @@ I would like to thank François Lafont who discovered quite a few bugs and made %\enlargethispage{4ex} \begin{thebibliography}{8} -\bibitem{chupin} Chupin, M.: \emph{Syracuse MetaPost/Animations.} URL: \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\texttt{http://melusine.eu.org/}} \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\texttt{syracuse/metapost/animations/chupin/?idsec=scara}} +\bibitem{chupin} Chupin, M.: \emph{Syracuse MetaPost/Animations.} URL: \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\nolinkurl{http://melusine.eu.org/}} \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\nolinkurl{syracuse/metapost/animations/chupin/?idsec=scara}} \bibitem{dvisvgm} \emph{dvisvgm: A fast DVI to SVG converter} URL: \url{http://dvisvgm.de} \bibitem{gilg05} Gilg, J.: PDF-Animationen. In: \emph{Die \TeX nische Kom\"odie}, Issue 4, 2005, pp.~30--37 \bibitem{hol} Holeček, J.; Sojka, P.: Animations in pdf\TeX-generated PDF. In: \emph{\TeX, XML, and Digital Typography}, Springer, 2004, pp.~179--191. doi:10.1007/978-3-540-27773-6\textunderscore14 \bibitem{luque12} Luque, M.: \emph{PSTricks : applications.} URL: \url{http://pstricks.blogspot.com} \bibitem{media4svg} \emph{The media4svg Package}. URL: \url{http://www.ctan.org/pkg/media4svg} \bibitem{media9} \emph{The media9 Package}. URL: \url{http://www.ctan.org/pkg/media9} -\bibitem{texsx} \emph{Beamer: animate package and overlay}. URL: \href{https://tex.stackexchange.com/a/385209}{\texttt{https://tex.stackexchange.com}}\\ \href{https://tex.stackexchange.com/a/385209}{\texttt{/a/385209}} +\bibitem{texsx} \emph{Beamer: animate package and overlay}. URL: \href{https://tex.stackexchange.com/a/385209}{\nolinkurl{https://tex.stackexchange.com}}\\ \href{https://tex.stackexchange.com/a/385209}{\nolinkurl{/a/385209}} \end{thebibliography} \end{document} diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty index 7e5b746210a..08dbf8a8810 100644 --- a/Master/texmf-dist/tex/latex/animate/animate.sty +++ b/Master/texmf-dist/tex/latex/animate/animate.sty @@ -13,7 +13,7 @@ \NeedsTeXFormat{LaTeX2e}[2022-06-01] -\def\@anim@version{2024/09/06} +\def\@anim@version{2024/09/17} \ProvidesPackage{animate} [\@anim@version\space PDF & SVG animations from files and inline graphics] @@ -3351,7 +3351,8 @@ \setboolean{@anim@@draft}{false}% } \newboolean{@anim@@nomouse} -\def\@anim@@method{\z@}%default animation method is `icon' +%\def\@anim@@method{\z@}%default animation method is `icon' +\def\@anim@@method{\@ne}%default animation method is `widget' \def\@anim@@ftype{}% file type (extension) of graphics \ExplSyntaxOn |