summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/animate/animate.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-07 22:25:34 +0000
committerKarl Berry <karl@freefriends.org>2019-03-07 22:25:34 +0000
commitac3543b34cf8626d011a6befdc4c9a9ffaefda5c (patch)
treeae5faa961b18e77f661658ccfbb9e4a68059d081 /Master/texmf-dist/tex/latex/animate/animate.sty
parenta18276525d13217fadb68391d20dddd2f5e77150 (diff)
animate (7mar19)
git-svn-id: svn://tug.org/texlive/trunk@50278 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.sty136
1 files changed, 34 insertions, 102 deletions
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty
index 058c363d5e2..20847c9d014 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{2019/01/23}
+\def\@anim@version{2019/03/06}
\ProvidesPackage{animate}
[\@anim@version\space PDF & SVG animations from files and inline graphics]
@@ -53,6 +53,7 @@
\DeclareOptionX{dvisvgm}{%
\setboolean{@anim@dvisvgm}{true}
\setboolean{@anim@dvips}{false}
+ \PassOptionsToPackage{dvisvgm}{pdfbase}
\PassOptionsToPackage{dvisvgm}{graphics}
}
\fi
@@ -239,56 +240,37 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% low level PDF/SVG operations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\if@anim@dvisvgm
- \RequirePackage{expl3}
- \ExplSyntaxOn
- \let\@anim@fpeval\fp_eval:n
- \ExplSyntaxOff
+\RequirePackage{pdfbase}
+\@ifpackagelater{pdfbase}{2017/09/29}{}{
+ \PackageError{animate}{%
+ Support package `pdfbase.sty' too old.%
+ }{%
+ Please install an up to date version of `pdfbase.sty'.\MessageBreak%
+ Aborting.%
+ }%
+}
- \setboolean{@anim@export}{false}
- \newcount\@anim@objnum
- \edef\@anim@hash{\string#}
+\ExplSyntaxOn
+\let\@anim@literal\pbs_literal:nn
- \def\@anim@xform#1#2#3#4#5{%
- \makebox[\z@][l]{\raisebox{\z@}[\z@][\z@]{%
- \special{dvisvgm:raw {?nl}<defs>{?nl}%
- <g transform='translate(-{?x},-{?y})' #4 id='obj\the\@anim@objnum'
- class='xform'>%
- }%
- \box#5%
- \special{dvisvgm:raw {?nl}</g>{?nl}</defs>}%
- }}%
- \xdef\@anim@lastxform{\@anim@hash obj\the\@anim@objnum}%
- \global\advance\@anim@objnum by \@ne%
- }
- \def\@anim@refxform#1{%
- \special{dvisvgm:raw
- {?nl}<use x='{?x}' y='{?y}' xlink:href='#1'/>%
- }%
- }
+\def\@anim@xform#1#2#3#4#5{
+ \pbs_pdfxform:nnnnn{#1}{#2}{#3}{#4}{#5}
+ \xdef\@anim@lastxform{\pbs_pdflastxform:}
+}
- \def\@anim@updatebbox#1#2#3{\special{dvisvgm:bbox #1 #2 #3}}
+\let\@anim@refxform\pbs_pdfrefxform:n
- \def\@anim@annot#1#2#3#4{%
- \special{dvisvgm:raw {?nl}<path d=}%
- \begingroup\setlength\unitlength{1pt}%
- \begin{picture}(0,0)% mark annotation rectangle
- \put(0,-\strip@pt\dimexpr#3\relax){% ll
- \special{dvisvgm:raw 'M{?x} {?y}}%
- }%
- \put(\strip@pt\dimexpr#1\relax,-\strip@pt\dimexpr#3\relax){% lr
- \special{dvisvgm:raw {?nl}L{?x} {?y}}%
- }%
- \put(\strip@pt\dimexpr#1\relax,\strip@pt\dimexpr#2\relax){% ur
- \special{dvisvgm:raw {?nl}L{?x} {?y}}%
- }%
- \put(0,\strip@pt\dimexpr#2\relax){% ul
- \special{dvisvgm:raw {?nl}L{?x} {?y} Z'}%
- }%
- \end{picture}%
- \endgroup%
- \special{dvisvgm:raw {?nl}opacity='0' #4/>}%
- }
+\def\@anim@annot#1#2#3#4{
+ \pbs_pdfannot:nnnn{#1}{#2}{#3}{#4}
+}
+
+\let\@anim@fpeval\fp_eval:n
+\ExplSyntaxOff
+
+\if@anim@dvisvgm
+ \setboolean{@anim@export}{false}
+
+ \def\@anim@updatebbox#1#2#3{\special{dvisvgm:bbox #1 #2 #3}}
%approach similar to OCGs, that is, putting the frame content in an svg group,
% <g id='...'>...</g>, whose visibility is then manipulated by JavaScript
@@ -298,27 +280,8 @@
}
\def\ocgbase@oc@bdc#1{\special{dvisvgm:raw {?nl}<g #1>}}
\def\ocgbase@oc@emc{\special{dvisvgm:raw {?nl}</g>}}
-
- \def\@anim@literal#1#2{%
- % #1: {} --> current location becomes (0,0), unit vectors 1bp right and up,
- % graphics state saved before and restored after the code in #2
- % #1: {direct|page} --> no origin translation, no saving of gr. state
- % #2: raw postscript
- \ifx\empty#1\empty\special{" #2}\else\special{ps:: #2}\fi%
- }
\else
- \RequirePackage{pdfbase}
- \@ifpackagelater{pdfbase}{2017/09/29}{}{
- \PackageError{animate}{%
- Support package `pdfbase.sty' too old.%
- }{%
- Please install an up to date version of `pdfbase.sty'.\MessageBreak%
- Aborting.%
- }%
- }
\ExplSyntaxOn
- \let\@anim@literal\pbs_literal:nn
-
\def\@anim@dictobj#1{
\pbs_pdfobj:nnn{}{dict}{#1}
\xdef\@anim@lastobj{\pbs_pdflastobj:}
@@ -334,25 +297,12 @@
\xdef\@anim@lastobj{\pbs_pdflastobj:}
}
- \def\@anim@xform#1#2#3#4#5{
- \pbs_pdfxform:nnnnn{#1}{#2}{#3}{#4}{#5}
- \xdef\@anim@lastxform{\pbs_pdflastxform:}
- }
-
- \let\@anim@refxform\pbs_pdfrefxform:n
-
- \def\@anim@annot#1#2#3#4{
- \pbs_pdfannot:nnnn{#1}{#2}{#3}{#4}
- }
-
\def\@anim@widget#1#2#3#4{
\pbs_pdfannot:nnnn{#1}{#2}{#3}{#4}
\pbs_appendtofields:n{\pbs_pdflastann:}
}
\let\@anim@pdfcatalog\pbs_pdfcatalog:n
-
- \let\@anim@fpeval\fp_eval:n
\ExplSyntaxOff
\RequirePackage{ocgbase} %OCG generating and configuration macros
@@ -1343,10 +1293,6 @@
\IfFileExists{#1\@anim@ext}{}{%
\gdef\@anim@ext{.jpeg}%
\IfFileExists{#1\@anim@ext}{}{%
- \gdef\@anim@ext{.jbig2}%
- \IfFileExists{#1\@anim@ext}{}{%
- \gdef\@anim@ext{.jb2}%
- \IfFileExists{#1\@anim@ext}{}{%
\gdef\@anim@ext{.jp2}%
\IfFileExists{#1\@anim@ext}{}{%
\gdef\@anim@ext{.j2k}%
@@ -1360,15 +1306,13 @@
`#1.png',\MessageBreak%
`#1.jpg',\MessageBreak%
`#1.jpeg',\MessageBreak%
- `#1.jbig2',\MessageBreak%
- `#1.jb2',\MessageBreak%
`#1.jp2',\MessageBreak%
`#1.j2k' or\MessageBreak%
`#1.jpx',\MessageBreak%
could be found.\MessageBreak%
Wrong file type? Mis-spelled file name?%
}{}%
- }}}}}}}}}}%
+ }}}}}}}}%
\else%
\gdef\@anim@ext{.#2}%
\IfFileExists{#1\@anim@ext}{}{%
@@ -1562,19 +1506,7 @@
\IfFileExists{#1.pdf}{%
\setboolean{@anim@multipage}{true}%
\gdef\@anim@ext{.pdf}%
- }{%
- \ifpdf% some extra file formats for pdftex/luatex
- \IfFileExists{#1.jbig2}{%
- \setboolean{@anim@multipage}{true}%
- \gdef\@anim@ext{.jbig2}%
- }{%
- \IfFileExists{#1.jb2}{%
- \setboolean{@anim@multipage}{true}%
- \gdef\@anim@ext{.jb2}%
- }{}%
- }%
- \fi%
- }%
+ }{}%
\else%
\IfFileExists{#1.#2}{%
\setboolean{@anim@multipage}{true}%
@@ -1613,7 +1545,7 @@
\xdef\@anim@last{\the\@anim@curframe}%
\fi%
}%
-\fi%
+\fi%
%environment for setting LTR typesetting direction
\def\@anim@beginLTR{%
@@ -4319,8 +4251,8 @@
try{onvisible();}catch(e){}%
}$%
}$%
- document.addEventListener('visibilitychange',onVisibilityChange);$%
- window.addEventListener('load',onload);$%
+ document.addEventListener('visibilitychange',onVisibilityChange);$%
+ window.addEventListener('load',onload);$%
\if@anim@nomouse\else
var permPause#1=false;
function onWidgetUpAction(event){$%