From 105c2b485b4ae12f3388fdc5643a9913c2ba9eb2 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 3 Feb 2016 22:57:41 +0000
Subject: animate (3feb16)

git-svn-id: svn://tug.org/texlive/trunk@39555 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/animate/animate.sty | 119 ++++++++++++------------
 1 file changed, 62 insertions(+), 57 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/animate/animate.sty')

diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty
index 01e997a25c4..d12b6fcab69 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}
 
-\def\@anim@version{2016/01/25}
+\def\@anim@version{2016/02/02}
 \ProvidesPackage{animate}
 [\@anim@version\space PDF animations from files and inline graphics]
 
@@ -790,7 +790,7 @@
             #2=\@anim@getkeyval{a#1.poster}%
           }{%
             \def\@anim@annotflag{/F 4}%
-          }{}%  
+          }{}%
         \fi%
       \fi%
     \fi%
@@ -809,8 +809,11 @@
   \or% ocg based
     \@anim@newocg{#1}{#2}%
     %initial visibility
-    \ifnum\@anim@poster=\@anim@mone% use last frame as poster
-      \ifthenelse{\equal{\@anim@getkeyval{a#1.poster}}{#2}}{}{%
+    \ifnum\@anim@poster=\@anim@mone\relax% use last frame as poster
+      \ifthenelse{%
+        \NOT\equal{\@anim@getkeyval{a#1.poster}}{}\AND%
+        #2=\@anim@getkeyval{a#1.poster}%
+      }{}{%
         \ocgbase@add@to@off@list{\@anim@curocg}%
       }%
     \else%
@@ -825,7 +828,7 @@
       \def\@anim@needresize{1}\fi%
     \ifdim\@anim@animdepth\p@=\@anim@zframedp\p@\else%
       \def\@anim@needresize{1}\fi%
-    \ifnum\@anim@needresize>\z@%
+    \ifnum\@anim@needresize>\z@\relax%
       \global\setbox\@anim@box=\hbox{%
         \raisebox{-\@anim@animdepth\p@}{%
           \resizebox*{\@anim@animwidth\p@}{%
@@ -1542,16 +1545,16 @@
       \ifx\@anim@first\@empty%
         \gdef\@anim@first{0}%
       \else%
-        \ifnum\@anim@first<\z@\gdef\@anim@first{0}\fi%
-        \ifnum\@anim@first>\@anim@lastpage%
+        \ifnum\@anim@first<\z@\relax\gdef\@anim@first{0}\fi%
+        \ifnum\@anim@first>\@anim@lastpage\relax%
           \xdef\@anim@first{\@anim@lastpage}%
         \fi%
       \fi%
       \ifx\@anim@last\@empty%
         \xdef\@anim@last{\@anim@lastpage}%
       \else%
-        \ifnum\@anim@last<\z@\gdef\@anim@last{0}\fi%
-        \ifnum\@anim@last>\@anim@lastpage%
+        \ifnum\@anim@last<\z@\relax\gdef\@anim@last{0}\fi%
+        \ifnum\@anim@last>\@anim@lastpage\relax%
           \xdef\@anim@last{\@anim@lastpage}%
         \fi%
       \fi%
@@ -1585,16 +1588,16 @@
         \ifx\@anim@first\@empty%
           \gdef\@anim@first{0}%
         \else%
-          \ifnum\@anim@first<\z@\gdef\@anim@first{0}\fi%
-          \ifnum\@anim@first>\@anim@lastpage%
+          \ifnum\@anim@first<\z@\relax\gdef\@anim@first{0}\fi%
+          \ifnum\@anim@first>\@anim@lastpage\relax%
             \xdef\@anim@first{\@anim@lastpage}%
           \fi%
         \fi%
         \ifx\@anim@last\@empty%
           \xdef\@anim@last{\@anim@lastpage}%
         \else%
-          \ifnum\@anim@last<\z@\gdef\@anim@last{0}\fi%
-          \ifnum\@anim@last>\@anim@lastpage%
+          \ifnum\@anim@last<\z@\relax\gdef\@anim@last{0}\fi%
+          \ifnum\@anim@last>\@anim@lastpage\relax%
             \xdef\@anim@last{\@anim@lastpage}%
           \fi%
         \fi%
@@ -1676,7 +1679,7 @@
   \fi%
   \def\@anim@relop{>}%
   \edef\@anim@numtemplate{\@anim@first}%
-  \ifnum\@anim@first>\@anim@last%
+  \ifnum\@anim@first>\@anim@last\relax%
     \edef\@anim@every{-\@anim@every}%
     \def\@anim@relop{<}%
     \edef\@anim@numtemplate{\@anim@last}%
@@ -1715,7 +1718,7 @@
     \xdef\@anim@fps{\@anim@nfps}%
     %
     %read all frames of the sequence
-    \loop\ifnum\@anim@curframe\@anim@relop\@anim@last\else%
+    \loop\ifnum\@anim@curframe\@anim@relop\@anim@last\relax\else%
       \if@anim@multipage%
         %embed graphics
         \@anim@ximage{\the\@anim@num}{\the\@anim@curframe@zb}{%
@@ -1740,7 +1743,7 @@
     \@anim@sanitizeJS%
     \if@anim@timeline\@anim@buildtmln{\the\@anim@num}\fi%
     % if last frame used as poster, write frame num to aux file
-    \ifnum\@anim@poster=\@anim@mone%
+    \ifnum\@anim@poster=\@anim@mone\relax%
       \@anim@keytoaux{a\the\@anim@num.poster}{\@anim@maxframe}%
     \fi%
     %insert animation widget & controls
@@ -1810,10 +1813,10 @@
     \xdef\@anim@animtotalheight{\strip@pt\dimexpr\@anim@totheightarg\relax}%
   \endgroup%
   %correct wrong option combination; totalheight overrides height
-  \ifnum\@anim@resizeflags=3% height+totalheight->totalheight
+  \ifnum\@anim@resizeflags=3\relax% height+totalheight->totalheight
     \global\@anim@resizeflags=\@ne%
   \fi%
-  \ifnum\@anim@resizeflags=7% height+totalheight+width->totalheight+width
+  \ifnum\@anim@resizeflags=7\relax% height+totalheight+width->totalheight+width
     \global\@anim@resizeflags=5%
   \fi%
   %now resize
@@ -1875,16 +1878,16 @@
   \@anim@pojscript{#1}%
   \@anim@otherjscript{#1}%
   \def\@anim@annotflag{}%
-  \ifnum\@anim@poster>\@anim@maxframe%
+  \ifnum\@anim@poster>\@anim@maxframe\relax%
     \PackageError{animate}{%
       Poster frame `\@anim@poster' is out-of-bounds\MessageBreak%
       on input line \the\inputlineno.\MessageBreak%
       Try option `poster=last'%
     }{}%
   \fi%
-  \ifnum\@anim@method=\z@%
+  \ifnum\@anim@method=\z@\relax%
     \def\@anim@annotflag{/F 4}% 4=allow printing
-    \ifnum\@anim@poster=\@anim@mtwo%
+    \ifnum\@anim@poster=\@anim@mtwo\relax%
       \ifdefined\@anim@apdummy\else% empty appearance dummy
         \setbox\@anim@box=\hbox{\phantom{x}}%
         \@anim@xform{0}{0}{\@anim@box}%
@@ -1910,7 +1913,7 @@
   %With icon and ocg method, we put one dummy widget below; this seems to be
   %necessary for the OCG visibility referenced by the /OC entry to work as
   %expected (if we place the animation on a PDF layer using ocgx2.sty).
-  \ifnum\@anim@method=\@ne\else%
+  \ifnum\@anim@method=\@ne\relax\else%
     \ifdefined\ocgxii@insert@OC%
       \ifthenelse{\equal{\ocgxii@insert@OC}{}}{}{%
         \@anim@pdfannot{\@anim@animwidth}{\@anim@animheight}{\@anim@animdepth}{%
@@ -2074,7 +2077,7 @@
       \@anim@getkeyval{btncol:\@anim@bgcolour:\@anim@fgcolour}}%
     \@anim@endsanitize%
     % if last frame used as poster, write frame num to aux file
-    \ifnum\@anim@poster=\@anim@mone%
+    \ifnum\@anim@poster=\@anim@mone\relax%
       \@anim@keytoaux{a\the\@anim@num.poster}{\@anim@maxframe}%
     \fi%
   \fi%
@@ -2099,14 +2102,14 @@
   \ifx\@anim@nfps\@empty% no change of frame rate
     \xdef\@anim@nfps{\@anim@pfps}%
   \fi%
-  \ifnum\@anim@curframe@zb=\z@%
+  \ifnum\@anim@curframe@zb=\z@\relax%
     \xdef\@anim@fps{\@anim@nfps}% default fps
     \xdef\@anim@nfpsat{\@anim@nfps}%
   \else%
     \xdef\@anim@nfpsat{\@anim@nfpsat,\@anim@nfps}%
   \fi%
   \ifdim\@anim@nfps\p@=\@anim@pfps\p@\else%
-    \ifnum\@anim@curframe@zb=\z@\else%
+    \ifnum\@anim@curframe@zb=\z@\relax\else%
       \setboolean{@anim@chfps}{true}% change fps
     \fi%
   \fi%
@@ -2117,7 +2120,7 @@
   \fi%
 }%
 \newcommand{\@anim@newframe}[1][]{% #1: new frame rate
-  \ifnum\@anim@skipfram=\z@%
+  \ifnum\@anim@skipfram=\z@\relax%
     \global\advance\@anim@curframe@zb by \@ne%
     \if@anim@draft\else%
       \if@anim@step\else%
@@ -2132,7 +2135,7 @@
   \ignorespaces%
 }
 \newcommand{\@anim@newframestar}[1][]{% starred variant for pausing animation
-  \ifnum\@anim@skipfram=\z@%            #1: new frame rate
+  \ifnum\@anim@skipfram=\z@\relax%            #1: new frame rate
     \if@anim@draft\else%
       \if@anim@step\else%
         \if@anim@timeline\else%
@@ -2169,8 +2172,8 @@
 \def\@anim@endframe#1#2{%
   \@anim@end%
   \end{lrbox}%
-  \ifnum\@anim@skipfram=\z@%
-    \ifnum#2=\z@%
+  \ifnum\@anim@skipfram=\z@\relax%
+    \ifnum#2=\z@\relax%
       \ifdim\wd\@anim@box=\z@%
         \PackageError{animate}{%
           Contents of first frame must not have zero width%
@@ -2199,7 +2202,7 @@
     \fi%
   \fi%
   \global\advance\@anim@skipfram by \@ne%
-  \ifnum\@anim@skipfram=\@anim@every%
+  \ifnum\@anim@skipfram=\@anim@every\relax%
     \global\@anim@skipfram=\z@%
   \fi%
 }
@@ -2224,7 +2227,7 @@
   %remove spaces from variable declaration list (2nd arg)
   \xdef\@anim@vardecls{#2\space}%
   \xdef\@anim@vardecls{\expandafter\zap@space\@anim@vardecls\@empty}%
-  \ifnum#1<\z@%
+  \ifnum#1<\z@\relax%
     \PackageError{animate}{%
       \protect\multiframe: first argument must be greater than zero%
     }{}%
@@ -2232,7 +2235,7 @@
   %parse list of variable declarations and build macro for updating them
   \expandafter\@anim@parsevars\@anim@vardecls,\@nil%
   \whiledo{\@anim@mulframecnt<#1}{%
-    \ifnum\@anim@mulframecnt>\z@%
+    \ifnum\@anim@mulframecnt>\z@\relax%
       \@anim@@newframe%
       \@anim@updatevars% update variables
     \fi%
@@ -2450,7 +2453,7 @@
       \expandafter\@anim@parseline\@anim@inputline:\@nil%
       %combine the layers of the current frame
       \global\@anim@curlayer=\z@%
-      \loop\ifnum\@anim@curlayer>\@anim@maxlayer\else%
+      \loop\ifnum\@anim@curlayer>\@anim@maxlayer\relax\else%
         \@anim@newkey{frmcontent@\the\@anim@curframe@zb}{%
           \@anim@getkeyval{frmcontent@\the\@anim@curframe@zb}%
           \@anim@getkeyval{%
@@ -2491,7 +2494,7 @@
   \closein\@anim@@tmlnfile%
   %check for unused transparencies
   \global\@anim@tmpcnt=\z@%
-  \loop\ifnum\@anim@transp>\@anim@tmpcnt%
+  \loop\ifnum\@anim@transp>\@anim@tmpcnt\relax%
     \ifcsname u@tr\the\@anim@tmpcnt\endcsname%
       {\expandafter\global\expandafter\let\csname
          u@tr\the\@anim@tmpcnt\endcsname\@undefined}%
@@ -2556,7 +2559,7 @@
   \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%
+    \ifnum\@anim@curlayer>\@anim@maxlayer\relax%
       \xdef\@anim@maxlayer{\the\@anim@curlayer}%
     \fi%
     \@anim@parsethird#2\@nil%
@@ -2592,12 +2595,12 @@
   }{%
     \@anim@getrepetitions#2\@nil%
   }%
-  \ifnum\@anim@repeats=\z@% =0 means: repeat until end of timeline
+  \ifnum\@anim@repeats=\z@\relax% =0 means: repeat until end of timeline
     \edef\@anim@repeatuntil{\@anim@frames}%
   \else%
     \global\@anim@tmpcnt=\@anim@curframe@zb%
     \global\advance\@anim@tmpcnt by \@anim@repeats%
-    \ifnum\@anim@frames<\@anim@tmpcnt%
+    \ifnum\@anim@frames<\@anim@tmpcnt\relax%
       \edef\@anim@repeatuntil{\@anim@frames}%
     \else%
       \edef\@anim@repeatuntil{\the\@anim@tmpcnt}%
@@ -2606,7 +2609,7 @@
   %test whether transparency stack of the current layer is to be cleared
   \ifthenelse{\equal{#1}{c}\OR\equal{#1}{C}}{%
     \global\@anim@tmpcnt=\@anim@curframe@zb%
-    \loop\ifnum\@anim@frames>\@anim@tmpcnt%
+    \loop\ifnum\@anim@frames>\@anim@tmpcnt\relax%
       %clear layer content
       \@anim@newkey{layercontent@\the\@anim@tmpcnt.\the\@anim@curlayer}{}%
       %clear list of transparencies used in the current layer
@@ -2615,10 +2618,10 @@
     \repeat%
   }{%
     %build contents of animation layer according to transparency specifications
-    \ifnum\@anim@transp<#1\else%   ignore non-existing
-      \ifnum\@anim@transp=#1\else% transparencies
+    \ifnum\@anim@transp<#1\relax\else%   ignore non-existing
+      \ifnum\@anim@transp=#1\relax\else% transparencies
         \global\@anim@tmpcnt=\@anim@curframe@zb%
-        \loop\ifnum\@anim@repeatuntil>\@anim@tmpcnt%
+        \loop\ifnum\@anim@repeatuntil>\@anim@tmpcnt\relax%
           %layer content
           \edef\@anim@tmpvar{\@anim@getkeyval{%
             layercontent@\the\@anim@tmpcnt.\the\@anim@curlayer}}%
@@ -2646,11 +2649,13 @@
   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak%
   @_In_certain_animation_frames,_transparencies_were_@\MessageBreak%
   @_included_multiple_times._This_may_considerably___@\MessageBreak%
-  @_slow__down_animation_speed._Revise_the_timeline__@\MessageBreak%
-  @_file_of_the_corresponding_animation!_See_the_____@\MessageBreak%
-  @_transcript_file__________________________________@\MessageBreak%
+  @_slow_down_animation_speed._Revise_the_timeline___@\MessageBreak%
+  @_file_of_the_corresponding_animation!_____________@\MessageBreak%
+  @__________________________________________________@\MessageBreak%
+  @_See_the_transcript_file__________________________@\MessageBreak%
   @___``\jobname.log''\MessageBreak%
-  @_for_additional_information!______________________@\MessageBreak%
+  @_for_additional_information_about_which_anima-____@\MessageBreak%
+  @_tion(s)_are_affected!____________________________@\MessageBreak%
   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%
 }%
 \endgroup
@@ -2755,7 +2760,7 @@
   \@anim@colours#1:\@nil%
   \xdef\@anim@bgcolour{\@anim@colour}%
   \if@anim@dvips
-    \ifnum\@anim@tmpcnt=\@ne%
+    \ifnum\@anim@tmpcnt=\@ne\relax%
       \xdef\@anim@bg{\@anim@colour\space setgray}%
     \else%
       \ifnum\@anim@tmpcnt=3\relax%
@@ -2767,7 +2772,7 @@
       \fi%
     \fi%
   \else% pdftex and dvipdfmx
-    \ifnum\@anim@tmpcnt=\@ne%
+    \ifnum\@anim@tmpcnt=\@ne\relax%
       \xdef\@anim@bg{\@anim@colour\space g}%
     \else%
       \ifnum\@anim@tmpcnt=3\relax%
@@ -2786,7 +2791,7 @@
   \@anim@colours#1:\@nil%
   \xdef\@anim@fgcolour{\@anim@colour}%
   \if@anim@dvips
-    \ifnum\@anim@tmpcnt=\@ne%
+    \ifnum\@anim@tmpcnt=\@ne\relax%
       \xdef\@anim@fg{\@anim@colour\space setgray}%
     \else%
       \ifnum\@anim@tmpcnt=3\relax%
@@ -2798,7 +2803,7 @@
       \fi%
     \fi%
   \else% pdftex and dvipdfmx
-    \ifnum\@anim@tmpcnt=\@ne%
+    \ifnum\@anim@tmpcnt=\@ne\relax%
       \xdef\@anim@fg{\@anim@colour\space G}%
       \xdef\@anim@@@fg{\@anim@colour\space g}%
     \else%
@@ -2861,7 +2866,7 @@
       }{%
         \gdef\@anim@poster{-2}%
       }{%
-        \ifnum#1<\z@%
+        \ifnum#1<\z@\relax%
           \PackageError{animate}{%
             Poster frame `#1' is out-of-bounds on\MessageBreak%
             input line \the\inputlineno.\MessageBreak%
@@ -2911,7 +2916,7 @@
   \gdef\@anim@end{#1}%
 }
 \define@key{anim@user}{every}{% embed every #1th frame
-  \ifnum#1<\@ne\gdef\@anim@every{1}\else\gdef\@anim@every{#1}\fi%
+  \ifnum#1<\@ne\relax\gdef\@anim@every{1}\else\gdef\@anim@every{#1}\fi%
 }
 \define@key{anim@user}{bb}{%
   \if@anim@grxloaded\g@addto@macro\@anim@gropts{, bb=#1}%
@@ -3035,7 +3040,7 @@
   \@anim@colours#1:\@nil%
   \xdef\@anim@@bgcolour{\@anim@colour}%
   \if@anim@dvips
-    \ifnum\@anim@tmpcnt=\@ne%
+    \ifnum\@anim@tmpcnt=\@ne\relax%
       \xdef\@anim@@bg{\@anim@colour\space setgray}%
     \else%
       \ifnum\@anim@tmpcnt=3\relax%
@@ -3047,7 +3052,7 @@
       \fi%
     \fi%
   \else% pdftex and dvipdfmx
-    \ifnum\@anim@tmpcnt=\@ne%
+    \ifnum\@anim@tmpcnt=\@ne\relax%
       \xdef\@anim@@bg{\@anim@colour\space g}%
     \else%
       \ifnum\@anim@tmpcnt=3\relax%
@@ -3072,7 +3077,7 @@
   \@anim@colours#1:\@nil%
   \xdef\@anim@@fgcolour{\@anim@colour}%
   \if@anim@dvips%
-    \ifnum\@anim@tmpcnt=\@ne%
+    \ifnum\@anim@tmpcnt=\@ne\relax%
       \xdef\@anim@@fg{\@anim@colour\space setgray}%
     \else%
       \ifnum\@anim@tmpcnt=3\relax%
@@ -3084,7 +3089,7 @@
       \fi%
     \fi%
   \else% pdftex and dvipdfmx
-    \ifnum\@anim@tmpcnt=\@ne%
+    \ifnum\@anim@tmpcnt=\@ne\relax%
       \xdef\@anim@@fg{\@anim@colour\space G}%
       \xdef\@anim@@@@fg{\@anim@colour\space g}%
     \else%
@@ -3186,7 +3191,7 @@
       }{%
         \gdef\@anim@@poster{-2}%
       }{%
-        \ifnum#1<\z@%
+        \ifnum#1<\z@\relax%
           \PackageError{animate}{%
             Poster frame `#1' is out-of-bounds on\MessageBreak%
             input line \the\inputlineno.\MessageBreak%
@@ -3687,7 +3692,7 @@
         \ifnum\@anim@poster=\@anim@mtwo %poster=none
           var ret=app.setTimeOut('a#1.seekFrame(-2)',1);%
         \fi%
-        \ifnum\@anim@poster>\@anim@mone%poster=<num>|first
+        \ifnum\@anim@poster>\@anim@mone %poster=<num>|first
           var ret=app.setTimeOut('a#1.seekFrame(\@anim@poster)',1);%
         \fi%
         \ifnum\@anim@poster=\@anim@mone %poster=last
-- 
cgit v1.2.3

