texlive[48455] Master/texmf-dist: animate (22aug18)

commits+karl at tug.org commits+karl at tug.org
Wed Aug 22 23:30:27 CEST 2018


Revision: 48455
          http://tug.org/svn/texlive?view=revision&revision=48455
Author:   karl
Date:     2018-08-22 23:30:27 +0200 (Wed, 22 Aug 2018)
Log Message:
-----------
animate (22aug18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/animate/ChangeLog
    trunk/Master/texmf-dist/doc/latex/animate/README
    trunk/Master/texmf-dist/doc/latex/animate/animate.pdf
    trunk/Master/texmf-dist/source/latex/animate/animate.tex
    trunk/Master/texmf-dist/tex/latex/animate/animate.sty

Modified: trunk/Master/texmf-dist/doc/latex/animate/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/doc/latex/animate/ChangeLog	2018-08-22 21:30:14 UTC (rev 48454)
+++ trunk/Master/texmf-dist/doc/latex/animate/ChangeLog	2018-08-22 21:30:27 UTC (rev 48455)
@@ -1,3 +1,6 @@
+2018-08-22
+	* new : `export' package option
+
 2018-06-27
 	* fix : documentation fixed (repository)
 

Modified: trunk/Master/texmf-dist/doc/latex/animate/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/animate/README	2018-08-22 21:30:14 UTC (rev 48454)
+++ trunk/Master/texmf-dist/doc/latex/animate/README	2018-08-22 21:30:27 UTC (rev 48455)
@@ -46,7 +46,8 @@
                     loop, palindrome, step,
                     poster[=first | <num> | last | none],
                     method=icon | widget | ocg, dvipdfmx, xetex,
-                    type=[<file ext>]
+                    type=[<file ext>],
+                    export
 
 
 \animategraphics[<options>]{<frame rate>}{<file basename>}{<first>}{<last>}

Modified: trunk/Master/texmf-dist/doc/latex/animate/animate.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/animate/animate.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/animate/animate.tex	2018-08-22 21:30:14 UTC (rev 48454)
+++ trunk/Master/texmf-dist/source/latex/animate/animate.tex	2018-08-22 21:30:27 UTC (rev 48455)
@@ -140,6 +140,7 @@
 \begin{verbatim}
 dvipdfmx
 xetex
+export
 autoplay
 autopause
 autoresume
@@ -163,14 +164,30 @@
 method=icon | widget | ocg
 poster[=first | <num> | last | none]
 \end{verbatim}
-Except for `\verb+dvipdfmx+' and `\verb+xetex+', the options above 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. Options without an argument are boolean options and can be negated, with the exception of package-only options `\verb+dvipdfmx+' and `\verb+xetex+', by appending `\verb+=false+'.
+Except for `\verb+dvipdfmx+', `\verb+xetex+' and `\verb+export+', the listed package 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. Options without an argument are boolean options and can be negated, with the exception of package-only options `\verb+dvipdfmx+', `\verb+xetex+' and `\verb+export+', by appending `\verb+=false+'.
 
 \begin{animateinline}[autoplay,loop,nomouse]{1}\strut\emph{Important:}\newframe[3]\end{animateinline} Option `\verb+-Ppdf+' should \emph{not} be used with \verb+dvips+ when converting DVI to Postscript. If you cannot do without, put `\verb+-D 1200+' \emph{after} `\verb+-Ppdf+' on the command line. Users of \LaTeX-aware text editors with menu-driven toolchain invocation, such as \TeX{}nicCenter, should check the configuration of the \verb+dvips+ call.
 
-All workflows require the `graphicx' package to be loaded explicitly. For \verb+dvipdfmx+, `\verb+dvipdfmx+' must be set as a document class option, \verb+\documentclass[dvipdfmx,...]{...}+, because this driver cannot be auto-detected by `animate', `graphicx' and other packages.
+All workflows require the `graphicx' package to be loaded explicitly. For \verb+dvipdfmx+, `\verb+dvipdfmx+' must be set as a document class option, as in
+%\verb+\documentclass[dvipdfmx,...]{...}+,
+\begin{verbatim}
+  \documentclass[dvipdfmx,...]{...}
+\end{verbatim}
+because this driver cannot be auto-detected by `animate', `graphicx' and other packages.
 
 Usually, a second \LaTeX{} run is necessary to resolve internally created object references. A warning message will be issued if appropriate.
 
+With option `\verb+export+', animation frames are output as individual pages of a multipage document that can be converted to other file formats, such as animated GIF. The `standalone' document class must be used together with `\verb+export+':
+\begin{verbatim}
+  \documentclass{standalone}
+  \usepackage[export]{animate}
+\end{verbatim}
+or
+\begin{verbatim}
+  \documentclass[export]{standalone}
+  \usepackage{animate}
+\end{verbatim}
+
 %\clearpage
 \section{The user interface}
 Package `animate' provides the command
@@ -464,7 +481,7 @@
 \normalsize
 Also, `animate' finds and warns about transparencies that have never been used in an animation timeline. This may help to avoid dead code in the final PDF.
 
-\clearpage
+%\clearpage
 \section{Programming interface}\label{sect:api}
 The package provides a simple JavaScript programming interface which gives access to the animation objects in a PDF file. A particular animation property or method can be accessed by
 \begin{verbatim}

Modified: trunk/Master/texmf-dist/tex/latex/animate/animate.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2018-08-22 21:30:14 UTC (rev 48454)
+++ trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2018-08-22 21:30:27 UTC (rev 48455)
@@ -13,7 +13,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 
-\def\@anim at version{2018/06/27}
+\def\@anim at version{2018/08/22}
 \ProvidesPackage{animate}
 [\@anim at version\space PDF animations from files and inline graphics]
 
@@ -56,6 +56,30 @@
   \setboolean{@anim at dvipdfmx}{true}
   \setboolean{@anim at dvips}{false}
 \fi
+%exporting animation frames
+\newboolean{@anim at export}
+\setboolean{@anim at export}{false}
+\newboolean{@anim at insideexport}
+\setboolean{@anim at insideexport}{false}
+\newenvironment{anim at export}{%
+  \global\@anim at insideexporttrue%
+}{%
+  \global\@anim at insideexportfalse%
+}
+\DeclareOptionX{export}{%
+  \@ifclassloaded{standalone}{}{
+    \PackageError{animate}{%
+      Option `export' requires `standalone' document class.\MessageBreak%
+      Replace current document class with `standalone'%
+    }{%
+      Put the line\MessageBreak%
+      `\protect\documentclass{standalone}'\MessageBreak%
+      at the beginning of the document preamble.%
+    }%
+  }%
+  \setboolean{@anim at export}{true}
+  \standaloneenv{anim at export}
+}
 
 \DeclareOptionX*{}\ProcessOptionsX*\relax %allow anything as an option
 %(remaining package options will be processed near end of this file)
@@ -416,18 +440,20 @@
       /T (#1.#2)%
     }%
   \or% ocg based
-    \@anim at newocg{#1}{#2}%
-    %initial visibility
-    \ifnum\@anim at poster=\@anim at mone\relax% use last frame as poster
-      \ifthenelse{%
-        \NOT\equal{\@anim at getkeyval{a#1.poster}}{}\AND%
-        #2=\@anim at getkeyval{a#1.poster}%
-      }{}{%
-        \ocgbase at add@to at off@list{\@anim at curocg}%
-      }%
-    \else%
-      \ifnum#2=\@anim at poster\relax\else%
-        \ocgbase at add@to at off@list{\@anim at curocg}%
+    \if at anim@export\else%
+      \@anim at newocg{#1}{#2}%
+      %initial visibility
+      \ifnum\@anim at poster=\@anim at mone\relax% use last frame as poster
+        \ifthenelse{%
+          \NOT\equal{\@anim at getkeyval{a#1.poster}}{}\AND%
+          #2=\@anim at getkeyval{a#1.poster}%
+        }{}{%
+          \ocgbase at add@to at off@list{\@anim at curocg}%
+        }%
+      \else%
+        \ifnum#2=\@anim at poster\relax\else%
+          \ocgbase at add@to at off@list{\@anim at curocg}%
+        \fi%
       \fi%
     \fi%
     \def\@anim at needresize{0}%
@@ -446,15 +472,19 @@
         }%
       }%
     \fi%
-    %frame insertion
-%    % marked content method
-%    \@anim at xform{0}{0}{}{}{\@anim at box}%
-%    \ocgbase at oc@bdc{\@anim at curocg}%
-%    \@anim at refxform{\@anim at lastxform}%
-%    \ocgbase at oc@emc%
-    % /OC  method
-    \@anim at xform{0}{0}{}{/OC \@anim at curocg}{\@anim at box}%
-    \@anim at refxform{\@anim at lastxform}%
+    \if at anim@export%
+      \box\@anim at box%
+    \else%
+      %frame insertion
+      % /OC method
+      \@anim at xform{0}{0}{}{/OC \@anim at curocg}{\@anim at box}%
+      \@anim at refxform{\@anim at lastxform}%
+%      % marked content method
+%      \@anim at xform{0}{0}{}{}{\@anim at box}%
+%      \ocgbase at oc@bdc{\@anim at curocg}%
+%      \@anim at refxform{\@anim at lastxform}%
+%      \ocgbase at oc@emc%
+    \fi%
   \fi%
 }
 
@@ -712,7 +742,7 @@
             %Distiller
             mark /CA \@anim at alpha /ca \@anim at alpha /SetTransparency pdfmark%
           } ifelse%
-        }%  
+        }%
         \@anim at refxform{\@anim at lastxform}%
       }\hss}%
       \@anim at xform{0}{0}{}{}{\@anim at box}%
@@ -1292,7 +1322,7 @@
 % #5: last frame (integer)
 \newcommand{\animategraphics}[5][]{%
   \@anim at endsanitize%
-  \leavevmode%
+  \if at anim@export\else\leavevmode\fi%
   \if at anim@grxloaded\else%
     \if at anim@dvipdfmx\if at anim@xetex%
       \@anim at missing{graphicx}\else%
@@ -1347,7 +1377,11 @@
   \fi%
   \global\@anim at curframe=\@anim at first%
   \global\@anim at curframe@zb=\z@%
-  %
+  \if at anim@export%
+    \def\@anim at method{\tw@}%
+    \setboolean{@anim at controls}{false}%
+    \setboolean{@anim at draft}{false}%
+  \fi%
   \if at anim@draft%
     \if at anim@multipage%
       %store file in a box
@@ -1379,8 +1413,14 @@
     \fi%
     \xdef\@anim at fps{\@anim at nfps}%
     %
+    \if at anim@export\if at anim@timeline%
+      \anim at export%
+    \fi\fi%
     %read all frames of the sequence
     \loop\ifnum\@anim at curframe\@anim at relop\@anim at last\relax\else%
+      \if at anim@export\if at anim@timeline\else%
+        \anim at export%
+      \fi\fi%
       \if at anim@multipage%
         %embed graphics
         \@anim at ximage{\the\@anim at num}{\the\@anim at curframe@zb}{%
@@ -1394,6 +1434,9 @@
         \@anim at ximage{\the\@anim at num}{\the\@anim at curframe@zb}{%
           \@anim at pathtofile}{1}%
       \fi%
+      \if at anim@export\if at anim@timeline\else%
+        \endanim at export%
+      \fi\fi%
       \global\advance\@anim at curframe by \@anim at every%
       \global\advance\@anim at curframe@zb by \@ne%
     \repeat%
@@ -1402,16 +1445,16 @@
     \global\advance\@anim at tmpcnt by -\@ne%
     \xdef\@anim at maxframe{\the\@anim at tmpcnt}% highest frame index
     %build timeline from optional timeline file
-    \@anim at sanitizeJS%
     \if at anim@timeline\@anim at buildtmln{\the\@anim at num}\fi%
     % if last frame used as poster, write frame num to aux file
     \ifnum\@anim at poster=\@anim at mone\relax%
       \@anim at keytoaux{a\the\@anim at num.poster}{\@anim at maxframe}%
     \fi%
-    %insert animation widget & controls
-    \@anim at insertwidgets{\the\@anim at num}{%
-      \@anim at getkeyval{btncol:\@anim at bgcolour:\@anim at fgcolour\@anim at lscape}}%
-    \@anim at endsanitize%
+    \if at anim@export\else%
+      %insert animation widget & controls
+      \@anim at insertwidgets{\the\@anim at num}{%
+        \@anim at getkeyval{btncol:\@anim at bgcolour:\@anim at fgcolour\@anim at lscape}}%
+    \fi%
   \fi%
   \@anim at endLTR%
   \endgroup%
@@ -1475,7 +1518,7 @@
 }
 
 \newcount\@anim at resizeflags% resizing flags according to options given.
-%
+
 %set animation widget dimensions
 \def\@anim at scale#1{% #1: box number
   \begingroup%
@@ -1695,10 +1738,11 @@
 % #2: frame rate (fps)
 \newenvironment{animateinline}[2][]{%
   \@anim at endsanitize%
-  \leavevmode%
+  \if at anim@export\else\leavevmode\fi%
   \@anim at reset% to default settings
   \begingroup%
   \@anim at beginLTR%
+  \ifdefined\NoHyper\NoHyper\fi% silently suppress any hyperref specials
   \ifcsname Ginput at path\endcsname% make use of graphic[xs] search path
     \let\input at path\Ginput at path%
   \fi%
@@ -1719,6 +1763,11 @@
   \fi%
   \global\@anim at curframe@zb=\z@%
   \global\@anim at skipfram=\z@%
+  \if at anim@export%
+    \def\@anim at method{\tw@}%
+    \setboolean{@anim at controls}{false}%
+    \setboolean{@anim at draft}{false}%
+  \fi%
   \if at anim@draft\else%
     %create button faces if necessary
     \if at anim@controls%
@@ -1733,8 +1782,10 @@
       \xdef\@anim at nfps{-1}%
       \@anim at processfpsarg{#2}%
     \fi%
+    \if at anim@export\if at anim@timeline%
+      \anim at export%
+    \fi\fi%
   \fi%
-  \ifdefined\NoHyper\NoHyper\fi% silently suppress any hyperref specials
   \let\newframe\@anim@@newframe%
   \let\multiframe\@anim at multiframe%
   \@anim at beginframe%
@@ -1742,7 +1793,6 @@
 }{%
   \unskip%
   \@anim at endframe{\the\@anim at num}{\the\@anim at curframe@zb}%
-  \ifdefined\endNoHyper\endNoHyper\fi%
   \global\advance\@anim at curframe@zb by \@ne%
   \if at anim@draft\else%
     \xdef\@anim at frames{\the\@anim at curframe@zb}% total number
@@ -1750,17 +1800,18 @@
     \global\advance\@anim at tmpcnt by -\@ne%
     \xdef\@anim at maxframe{\the\@anim at tmpcnt}% highest frame index
     %build timeline from optional timeline file
-    \@anim at sanitizeJS%
     \if at anim@timeline\@anim at buildtmln{\the\@anim at num}\fi%
     %insert animation widget & controls
-    \@anim at insertwidgets{\the\@anim at num}{%
-      \@anim at getkeyval{btncol:\@anim at bgcolour:\@anim at fgcolour\@anim at lscape}}%
-    \@anim at endsanitize%
+    \if at anim@export\else%
+     \@anim at insertwidgets{\the\@anim at num}{%
+       \@anim at getkeyval{btncol:\@anim at bgcolour:\@anim at fgcolour\@anim at lscape}}%
+    \fi%
     % if last frame used as poster, write frame num to aux file
     \ifnum\@anim at poster=\@anim at mone\relax%
       \@anim at keytoaux{a\the\@anim at num.poster}{\@anim at maxframe}%
     \fi%
   \fi%
+  \ifdefined\endNoHyper\endNoHyper\fi%
   \@anim at endLTR%
   \endgroup%
   \global\advance\@anim at num by \@ne%
@@ -1845,6 +1896,9 @@
 
 %starts new frame
 \def\@anim at beginframe{%
+  \if at anim@export\if at anim@timeline\else\ifnum\@anim at skipfram=\z@\relax%
+    \anim at export%
+  \fi\fi\fi%
   \begingroup%
   \lrbox{\@anim at box}% store graphics in a box
   \ifdefined\@anim at curTxtDir\textdir\@anim at curTxtDir\fi%
@@ -1887,6 +1941,9 @@
     \if at anim@draft\else%
       \@anim at xinline{#1}{#2}{\@anim at box}{!}%
     \fi%
+    \if at anim@export\if at anim@timeline\else%
+      \endanim at export%
+    \fi\fi%
   \fi%
   \global\advance\@anim at skipfram by \@ne%
   \ifnum\@anim at skipfram=\@anim at every\relax%
@@ -2086,11 +2143,13 @@
 \newcount\@anim at curfield %current field of input line processed
 
 \def\@anim at buildtmln#1{% #1:@anim at num
-  \endlinechar=-1% suppress trailing space at input line end
   \global\@anim at curframe@zb=\z@%
   %read timeline file a first time to get number of lines (= number of frames)
   \openin\@anim@@tmlnfile=\@anim at tmlnfile%
-  \read\@anim@@tmlnfile to \@anim at inputline%
+  \@anim at sanitizeJS%
+  \endlinechar=-1% suppress trailing space at input line end
+  \global\read\@anim@@tmlnfile to \@anim at inputline%
+  \@anim at endsanitize%
   \edef\@anim at inputline{\@anim at inputline\space}%
   %remove all spaces from input line
   \edef\@anim at inputline{\expandafter\zap at space\@anim at inputline\@empty}%
@@ -2103,7 +2162,10 @@
       \@anim at newkey{frmcontent@\the\@anim at curframe@zb}{}%
       \global\advance\@anim at curframe@zb by \@ne%
     }%
-    \read\@anim@@tmlnfile to \@anim at inputline%
+    \@anim at sanitizeJS%
+    \endlinechar=-1% suppress trailing space at input line end
+    \global\read\@anim@@tmlnfile to \@anim at inputline%
+    \@anim at endsanitize%
     \edef\@anim at inputline{\@anim at inputline\space}%
     \edef\@anim at inputline{\expandafter\zap at space\@anim at inputline\@empty}%
     \ifeof\@anim@@tmlnfile\setboolean{@anim at eof}{true}\else%
@@ -2120,7 +2182,10 @@
   %reopen timeline file and build timeline
   \openin\@anim@@tmlnfile=\@anim at tmlnfile%
   \global\@anim at lineno=\z@%
-  \read\@anim@@tmlnfile to \@anim at inputline%
+  \@anim at sanitizeJS%
+  \endlinechar=-1% suppress trailing space at input line end
+  \global\read\@anim@@tmlnfile to \@anim at inputline%
+  \@anim at endsanitize%
   \edef\@anim at inputlinenospc{\@anim at inputline\space}%
   \edef\@anim at inputlinenospc{%
     \expandafter\zap at space\@anim at inputlinenospc\@empty}%
@@ -2153,11 +2218,13 @@
         \global\advance\@anim at curlayer by \@ne%
       \repeat%
       %detect multiple inclusion of the same transp. in the current frame
-      \edef\@anim at trlst{%
+      \xdef\@anim at trlst{%
         \the\@anim at curframe@zb.\@anim at getkeyval{trlst@\the\@anim at curframe@zb}}%
       \expandafter\@anim at findmult\@anim at trlst,\@nil%
+      \if at anim@export\if at anim@insideexport\else\anim at export\fi\fi%
       %insert frame Widget
       \@anim at makeframe{#1}{\the\@anim at curframe@zb}%
+      \if at anim@export\endanim at export\fi%
       %clean-up
       \expandafter\@anim at resetmult\@anim at trlst,\@nil%
       \@anim at newkey{trlst@\the\@anim at curframe@zb}{}%
@@ -2165,12 +2232,16 @@
       \message{.}%
       \global\advance\@anim at curframe@zb by \@ne%
     }%
-    \read\@anim@@tmlnfile to \@anim at inputline%
+    \@anim at sanitizeJS%
+    \endlinechar=-1% suppress trailing space at input line end
+    \global\read\@anim@@tmlnfile to \@anim at inputline%
+    \@anim at endsanitize%
     \edef\@anim at inputlinenospc{\@anim at inputline\space}%
     \edef\@anim at inputlinenospc{%
       \expandafter\zap at space\@anim at inputlinenospc\@empty}%
     \ifeof\@anim@@tmlnfile\setboolean{@anim at eof}{true}\else%
-      \setboolean{@anim at eof}{false}\fi%
+      \setboolean{@anim at eof}{false}%
+    \fi%
   }%
   \message{\the\@anim at curframe@zb\space frames built}%
   \closein\@anim@@tmlnfile%
@@ -2760,6 +2831,13 @@
     }{}%
   }%
 }%
+\define at key{anim at pkg}{export}[]{
+  \ifthenelse{\equal{#1}{}}{}{%
+    \PackageError{animate}{%
+      Package option `export' does not accept arguments%
+    }{}%
+  }%
+}%
 \def\@anim@@bg{}
 \def\@anim@@bgcolour{}
 \define at key{anim at pkg}{buttonbg}{%background colour of buttons
@@ -2990,6 +3068,9 @@
 }%
 \define at key{anim at pkg}{draft}[true]{%
   \setboolean{@anim@@draft}{#1}%
+  \if at anim@export%
+    \setboolean{@anim@@draft}{false}%
+  \fi%
 }
 \define at key{anim at pkg}{final}[true]{%
   \ifthenelse{\equal{#1}{true}}{%



More information about the tex-live-commits mailing list