diff options
author | Karl Berry <karl@freefriends.org> | 2016-01-19 22:36:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-01-19 22:36:32 +0000 |
commit | 807e4597819bf7720671f8cc5aa83f16655ebf07 (patch) | |
tree | e188f657fe96f4ef0024f8f9e8c0ec78e8149eb9 /Master/texmf-dist/tex/latex/animate/animate.sty | |
parent | de944aa8e0c81b76bdab911cc3781d446749d356 (diff) |
animate (19jan16)
git-svn-id: svn://tug.org/texlive/trunk@39429 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/animate/animate.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/animate/animate.sty | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty index 5ef33bbde6a..6f823f8eaab 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{2015/11/02} +\def\@anim@version{2016/01/19} \ProvidesPackage{animate} [\@anim@version\space PDF animations from files and inline graphics] @@ -192,22 +192,35 @@ \def\@anim@newkey#1#2{{\expandafter\xdef\csname#1\endcsname{#2}}} \def\@anim@getkeyval#1{\ifcsname#1\endcsname\csname#1\endcsname\fi} +\def\@animate@rerunwarn{% + \ifcsname @anim@rerunwarned\endcsname\else% + \gdef\@anim@rerunwarned{}% + \PackageWarningNoLine{animate}{% + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak + @@ Rerun to get internal references right! @@\MessageBreak + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}% + \fi% +} + %macro for writing global defs to external *.aux file \def\@anim@keytoaux#1#2{% \@bsphack\protected@write\@mainaux{}{% \string\@anim@newkey{#1}{#2}% }\@esphack% - \ifcsname#1\endcsname\else% - \ifcsname @anim@rerunwarned\endcsname\else% - \gdef\@anim@rerunwarned{}% - \AtEndDocument{% - \PackageWarningNoLine{animate}{% - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak - @@ Rerun to get internal references right! @@\MessageBreak - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}% - }% + \ifthenelse{\equal{\@anim@getkeyval{#1}}{#2}}{}{% + \AtEndDocument{\@animate@rerunwarn}}% +} + +\let\AtEndDvi@CheckImpl@Orig\AtEndDvi@CheckImpl% +\def\AtEndDvi@CheckImpl{% + \AtEndDvi@CheckImpl@Orig% + \@ifundefined{AtEndDvi@LastPage}{% + \@animate@rerunwarn% + }{% + \ifnum\AtEndDvi@LastPage=\value{abspage}\else% + \@animate@rerunwarn% \fi% - \fi% + }% } %missing package error message @@ -772,7 +785,6 @@ \def\@anim@annotflag{/F 4}% not hidden + print (4) \else% \ifnum\@anim@poster=\@anim@mone% use last frame as poster - \@anim@keytoaux{a#1.poster}{#2}% \ifthenelse{\equal{\@anim@getkeyval{a#1.poster}}{#2}}{% \def\@anim@annotflag{/F 4}% }{}% @@ -795,7 +807,6 @@ \@anim@newocg{#1}{#2}% %initial visibility \ifnum\@anim@poster=\@anim@mone% use last frame as poster - \@anim@keytoaux{a#1.poster}{#2}% \ifthenelse{\equal{\@anim@getkeyval{a#1.poster}}{#2}}{}{% \ocgbase@add@to@off@list{\@anim@curocg}% }% @@ -1725,6 +1736,10 @@ %build timeline from optional timeline file \@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% + \@anim@keytoaux{a\the\@anim@num.poster}{\@anim@maxframe}% + \fi% %insert animation widget & controls \@anim@insertwidgets{\the\@anim@num}{% \@anim@getkeyval{btncol:\@anim@bgcolour:\@anim@fgcolour}}% @@ -1985,8 +2000,6 @@ \fi% } -\newboolean{@anim@inside} % for checking whether we are inside the -\setboolean{@anim@inside}{false} % `animateinline' environment \newboolean{@anim@pauseframes} % true if \newframe* is being used \newboolean{@anim@chfps} % true if \newframe or \newframe* is being used % with optional `new frame rate' argument @@ -2000,7 +2013,6 @@ \newenvironment{animateinline}[2][]{% \@anim@endsanitize% \leavevmode% - \setboolean{@anim@inside}{true}% \@anim@reset% to default settings \begingroup% % make use of graphic[xs] search path @@ -2037,6 +2049,8 @@ \fi% \fi% \ifdefined\NoHyper\NoHyper\fi% silently suppress any hyperref specials + \let\newframe\@anim@@newframe% + \let\multiframe\@anim@multiframe% \@anim@beginframe% \ignorespaces% }{% @@ -2056,24 +2070,21 @@ \@anim@insertwidgets{\the\@anim@num}{% \@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% + \@anim@keytoaux{a\the\@anim@num.poster}{\@anim@maxframe}% + \fi% \fi% \endgroup% \global\advance\@anim@num by \@ne% - \setboolean{@anim@inside}{false}% } \let\@anim@animateinline\animateinline \def\animateinline{\@anim@sanitizeColon\@anim@animateinline} %usercommand for use within `animateinline' environment; %terminates the current frame and starts a new one -\def\newframe{% +\def\@anim@@newframe{% aliased to \newframe inside `animateinline' \unskip% - \if@anim@inside\else% - \PackageError{animate}{% - \protect\newframe\space cannot be used outside `animateinline'% - \MessageBreak environment% - }{}% - \fi% \@anim@endframe{\the\@anim@num}{\the\@anim@curframe@zb}% \@ifstar\@anim@newframestar\@anim@newframe% } @@ -2195,14 +2206,10 @@ \newcount\@anim@mulframecnt %takes current loop No. of \multiframe \newboolean{@anim@insidemulti} % for checking whether we are inside \multiframe \setboolean{@anim@insidemulti}{false} -\newcommand{\multiframe}[3]{% #1: #repetitions, #2: vars, #3: frame content +\newcommand{\@anim@multiframe}[3]{% + % aliased to \multiframe inside `animateinline' + % #1: #repetitions, #2: vars, #3: frame content \unskip% - \if@anim@inside\else% - \PackageError{animate}{% - \protect\multiframe\space cannot be used outside `animateinline'% - \MessageBreak environment% - }{}% - \fi% \if@anim@insidemulti% \PackageError{animate}{\protect\multiframe\space cannot be nested}{}% \fi% @@ -2223,7 +2230,7 @@ \expandafter\@anim@parsevars\@anim@vardecls,\@nil% \whiledo{\@anim@mulframecnt<#1}{% \ifnum\@anim@mulframecnt>\z@% - \newframe% + \@anim@@newframe% \@anim@updatevars% update variables \fi% \global\advance\@anim@mulframecnt by \@ne% |