From 811714247a66acfce87bba00b9758441ff9d1413 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 1 Feb 2022 03:02:08 +0000 Subject: CTAN sync 202202010302 --- macros/latex/contrib/animate/ChangeLog | 3 + macros/latex/contrib/animate/animate.pdf | Bin 3865127 -> 3753532 bytes macros/latex/contrib/animate/animate.sty | 433 +++++----- macros/latex/contrib/easybook/easybook.dtx | 6 +- macros/latex/contrib/easybook/easybook.pdf | Bin 575831 -> 575824 bytes macros/latex/contrib/easybook/easybook.tex | 8 +- macros/latex/contrib/spbmark/spbmark.pdf | Bin 74237 -> 75040 bytes macros/latex/contrib/spbmark/spbmark.sty | 2 +- macros/latex/contrib/spbmark/spbmark.tex | 11 +- macros/latex/contrib/zref-vario/CHANGELOG.md | 8 + macros/latex/contrib/zref-vario/DEPENDS.txt | 2 + macros/latex/contrib/zref-vario/MANIFEST.md | 148 ++++ macros/latex/contrib/zref-vario/README.md | 19 + .../latex/contrib/zref-vario/zref-vario-code.pdf | Bin 0 -> 539239 bytes .../latex/contrib/zref-vario/zref-vario-code.tex | 52 ++ macros/latex/contrib/zref-vario/zref-vario.dtx | 908 +++++++++++++++++++++ macros/latex/contrib/zref-vario/zref-vario.ins | 94 +++ macros/latex/contrib/zref-vario/zref-vario.pdf | Bin 0 -> 119911 bytes macros/latex/contrib/zref-vario/zref-vario.tex | 261 ++++++ macros/luatex/generic/lua-widow-control/README.md | 2 +- .../lua-widow-control/lua-widow-control.lua | 4 +- .../lua-widow-control/lua-widow-control.pdf | Bin 314157 -> 313200 bytes .../lua-widow-control/lua-widow-control.sty | 14 +- .../lua-widow-control/lua-widow-control.tex | 2 +- .../lua-widow-control/lwc-documentation.tex | 2 +- .../lua-widow-control/t-lua-widow-control.mkxl | 4 +- .../luatex/latex/autopuncitems/autopuncitems.lua | 13 +- .../luatex/latex/autopuncitems/autopuncitems.pdf | Bin 41875 -> 38603 bytes .../luatex/latex/autopuncitems/autopuncitems.sty | 6 +- .../luatex/latex/autopuncitems/autopuncitems.tex | 36 +- macros/unicodetex/latex/fontsetup/README | 2 +- .../latex/fontsetup/doc/fontsetup-doc.pdf | Bin 460242 -> 518759 bytes .../latex/fontsetup/doc/fontsetup-doc.tex | 24 +- .../latex/fontsetup/doc/fspsample-concrete.pdf | Bin 0 -> 26645 bytes .../latex/fontsetup/doc/fspsample-talos.pdf | Bin 0 -> 33605 bytes .../unicodetex/latex/fontsetup/doc/fspsample.tex | 2 + macros/unicodetex/latex/fontsetup/fontsetup.sty | 11 + macros/unicodetex/latex/fontsetup/fspconcrete.sty | 33 + macros/unicodetex/latex/fontsetup/fsptalos.sty | 33 + 39 files changed, 1891 insertions(+), 252 deletions(-) create mode 100644 macros/latex/contrib/zref-vario/CHANGELOG.md create mode 100644 macros/latex/contrib/zref-vario/DEPENDS.txt create mode 100644 macros/latex/contrib/zref-vario/MANIFEST.md create mode 100644 macros/latex/contrib/zref-vario/README.md create mode 100644 macros/latex/contrib/zref-vario/zref-vario-code.pdf create mode 100644 macros/latex/contrib/zref-vario/zref-vario-code.tex create mode 100644 macros/latex/contrib/zref-vario/zref-vario.dtx create mode 100644 macros/latex/contrib/zref-vario/zref-vario.ins create mode 100644 macros/latex/contrib/zref-vario/zref-vario.pdf create mode 100644 macros/latex/contrib/zref-vario/zref-vario.tex create mode 100644 macros/unicodetex/latex/fontsetup/doc/fspsample-concrete.pdf create mode 100644 macros/unicodetex/latex/fontsetup/doc/fspsample-talos.pdf create mode 100644 macros/unicodetex/latex/fontsetup/fspconcrete.sty create mode 100644 macros/unicodetex/latex/fontsetup/fsptalos.sty (limited to 'macros') diff --git a/macros/latex/contrib/animate/ChangeLog b/macros/latex/contrib/animate/ChangeLog index 0d6aa65da5..b43af114e4 100644 --- a/macros/latex/contrib/animate/ChangeLog +++ b/macros/latex/contrib/animate/ChangeLog @@ -1,3 +1,6 @@ +2022-01-31 + * improvement: optimizing XObject nesting for smaller output files + 2022-01-25 * improvement: svg clipping optimized for smaller output size diff --git a/macros/latex/contrib/animate/animate.pdf b/macros/latex/contrib/animate/animate.pdf index eb1b44c371..7fe63d0830 100644 Binary files a/macros/latex/contrib/animate/animate.pdf and b/macros/latex/contrib/animate/animate.pdf differ diff --git a/macros/latex/contrib/animate/animate.sty b/macros/latex/contrib/animate/animate.sty index fe5636586d..9a4fed2374 100644 --- a/macros/latex/contrib/animate/animate.sty +++ b/macros/latex/contrib/animate/animate.sty @@ -13,7 +13,7 @@ \NeedsTeXFormat{LaTeX2e}[2020-10-01] -\def\@anim@version{2022/01/25} +\def\@anim@version{2022/01/31} \ProvidesPackage{animate} [\@anim@version\space PDF & SVG animations from files and inline graphics] @@ -312,16 +312,16 @@ %helper macro that typesets graphics file into savebox \if@anim@dvips - \def\@anim@filebox#1#2#3{% dvips: no multi-page support + \def\@anim@filebox#1#2#3#4{% dvips: no multi-page support \edef\@anim@curfile{[#3]{#1}}% - \global\setbox\@anim@box=\hbox{% + \setbox#4=\hbox{% \expandafter\includegraphics\@anim@curfile}% } \else %pdfTeX, LuaTeX, dvipdfmx, xetex, dvisvgm - \def\@anim@filebox#1#2#3{% + \def\@anim@filebox#1#2#3#4{% \edef\@anim@curfile{[#3,page=#2]{#1}}% - \global\setbox\@anim@box=\hbox{% + \setbox#4=\hbox{% \expandafter\includegraphics\@anim@curfile}% } \fi @@ -357,14 +357,16 @@ \edef\@anim@curxform{\@anim@getkeyval{xform:\@anim@fingerprint}}% \ifthenelse{\equal{\@anim@curxform}{}}{% % new ".." - \@anim@filebox{#3}{#4}{#5}% store file in a box - \@anim@newkey{natdims:\@anim@fingerprint}{% - {\the\wd\@anim@box}{\the\ht\@anim@box}{\the\dp\@anim@box}% + \@anim@filebox{#3}{#4}{#5}{\@anim@box}% store file in a box + \edef\@anim@natdims{{\the\wd\@anim@box}{\the\ht\@anim@box}{\the\dp\@anim@box}}% + \@anim@xinline{#1}{#2}{\@anim@box}{newfile}% Form XObject creation + \@anim@newkey{natdims:\@anim@lastxform}{\@anim@natdims}% + \@anim@newkey{scaleddims:\@anim@lastxform}{% scaled dimensions + {\@anim@animwidth}{\@anim@animheight}{\@anim@animdepth}% }% - \@anim@xinline{#1}{#2}{\@anim@box}{newfile}% delegate Form XObject creation - \@anim@newkey{xform:\@anim@fingerprint}{\@anim@@lastxform}% - }{% file known, re-using existing form xobject - \edef\@anim@curndims{\@anim@getkeyval{natdims:\@anim@fingerprint}}% + \@anim@newkey{xform:\@anim@fingerprint}{\@anim@lastxform}% + }{% file known, re-using existing xform + \edef\@anim@curndims{\@anim@getkeyval{scaleddims:\@anim@curxform}}% \setbox\@anim@box=\hbox to \@anim@xformnatwd{\@anim@curndims}{% \vrule width \z@ height \@anim@xformnatht{\@anim@curndims} @@ -372,76 +374,67 @@ \@anim@refxform{\@anim@curxform}% \hss% }% - \global\let\@anim@@lastxform\@anim@curxform% - \@anim@xinline{#1}{#2}{\@anim@box}{knownfile}% + \@anim@xinline{#1}{#2}{\@anim@box}{\@anim@curxform}% }% } %creates Form XObject from box contents -\def\@anim@xinline#1#2#3#4{% - \def\@anim@status{#4}% "newfile", "knownfile" or "inline" (inline graphics) - \edef\@anim@curwd{\the\wd#3}% +\def\@anim@xinline#1#2#3#4{% #1 anim num, #2 frame num, #3 box num, #4 status ( + \edef\@anim@curwd{\the\wd#3}% `newfile', xform ref of known file or `inline') \edef\@anim@curht{\the\ht#3}% \edef\@anim@curdp{\the\dp#3}% + % measure 0th frame, to determine final animation widget dims \ifnum#2=\z@\relax% - %measure 0th frame - \setbox\@anim@measbox=\hbox to \wd#3{% - \vrule width \z@ height \ht#3 depth \dp#3\hss}% - %determine final dims of animation widget + \ifthenelse{\equal{#4}{newfile}\OR\equal{#4}{inline}}{% + \setbox\@anim@measbox=\hbox to \wd#3{% + \vrule width \z@ height \ht#3 depth \dp#3\hss}% + }{% known file + \edef\@anim@curndims{\@anim@getkeyval{natdims:#4}}% + \setbox\@anim@measbox=\hbox to \@anim@xformnatwd{\@anim@curndims}{% + \vrule width \z@ + height \@anim@xformnatht{\@anim@curndims} + depth \@anim@xformnatdp{\@anim@curndims}% + \hss% + }% + }% \@anim@scale{\@anim@measbox}% - \@anim@keytoaux{a#1.wdbp}{\strip@pt\dimexpr0.996264\dimexpr\@anim@animwidth}% - \@anim@keytoaux{a#1.htbp}{\strip@pt\dimexpr0.996264\dimexpr\@anim@animheight}% - \@anim@keytoaux{a#1.thtbp}{\strip@pt\dimexpr0.996264\dimexpr\@anim@animtotalheight}% + \if@anim@dvisvgm% for clipping purposes + \@anim@keytoaux{a#1.wdbp}{\strip@pt\dimexpr0.996264\dimexpr\@anim@animwidth}% + \@anim@keytoaux{a#1.htbp}{\strip@pt\dimexpr0.996264\dimexpr\@anim@animheight}% + \@anim@keytoaux{a#1.thtbp}{\strip@pt\dimexpr0.996264\dimexpr\@anim@animtotalheight}% + \fi% \fi% - %test if natural dimensions of the current frame differ from - %final widget size \def\@anim@needresize{0}% + % test if content dimensions differ from those of the final widget \ifdim\@anim@curwd=\@anim@animwidth\else\def\@anim@needresize{1}\fi% \ifdim\@anim@curht=\@anim@animheight\else\def\@anim@needresize{1}\fi% \ifdim\@anim@curdp=\@anim@animdepth\else\def\@anim@needresize{1}\fi% - %if it's a new file, make xobject from it at its natural size - \ifthenelse{\equal{\@anim@status}{newfile}}{% - \@anim@xform{1}{0}{}{}{#3}% `{1}'-->with additional resources (opacity etc.) - \global\let\@anim@@lastxform\@anim@lastxform% - \def\@anim@status{knownfile}% - \ifnum\@anim@needresize>\z@\relax% - \global\setbox#3=\hbox to \@anim@curwd{% - \vrule width \z@ height \@anim@curht depth \@anim@curdp% - \@anim@refxform{\@anim@lastxform}% - \hss% - }% - \fi% - }{% - \ifthenelse{\equal{\@anim@status}{knownfile}}{% - \global\let\@anim@lastxform\@anim@@lastxform% - }{}% - }% - %adjust size of current frame to final animation dims, if necessary + % resize content to final dimensions, if necessary \ifnum\@anim@needresize>\z@\relax% - \global\setbox#3=\hbox{% + \setbox#3=\hbox{% \raisebox{-\@anim@animdepth}{% \resizebox*{\@anim@animwidth}{% \@anim@animtotalheight}{\raisebox{\depth}{\box#3}}% }% }% - \ifthenelse{\equal{\@anim@status}{knownfile}}{% - \@anim@xform{0}{0}{}{}{#3}% without additional Resources - }{}% - \fi% - %distill box with inline graphics to xobject - \ifthenelse{\equal{\@anim@status}{inline}}{% - \@anim@xform{1}{0}{}{}{#3}% with additional Resources - }{}% - %keep a record of XObject number - \@anim@newkey{img@#2}{\@anim@lastxform}% - \if@anim@timeline\else% - \@anim@newkey{frmcontent@#2}{\@anim@getkeyval{img@#2},}% - \@anim@makeframe{#1}{#2}% \fi% + \ifthenelse{\equal{#4}{newfile}\OR\equal{#4}{inline}}{% + \@anim@xform{1}{1}{}{}{#3}% + %keep a record of XObject number, needed when timeline is built + \@anim@newkey{img@#2}{\@anim@lastxform}% + }{% + %known file + \ifnum\@anim@needresize>\z@% + \@anim@xform{0}{1}{}{}{#3}% + \@anim@newkey{img@#2}{\@anim@lastxform}% + \else% + \@anim@newkey{img@#2}{#4}% + \fi% + }% \message{}% } -\def\@anim@insertfrmcontent#1,#2\@nil{% +\def\@anim@refxformlist#1,#2\@nil{% \ifthenelse{\equal{#1}{}}{}{% \if@anim@dvips% \@anim@refxform{{#1}}% @@ -449,38 +442,79 @@ \@anim@refxform{#1}% \fi% }% - \ifthenelse{\equal{#2}{}}{}{\@anim@insertfrmcontent#2\@nil}% + \ifthenelse{\equal{#2}{}}{}{\@anim@refxformlist#2\@nil}% } -%inserts one animation frame into the output acc. to -% \ifcase\@anim@method as -% 0 & 1: non-interactive Widget annotation -% 2: Form XObject referenced in the page content, tagged as OC -% or dvisvgm -\def\@anim@makeframe#1#2{% - %container box - \edef\@anim@tmpvar{\@anim@getkeyval{frmcontent@#2},}% - \global\setbox\@anim@box=\hbox to \@anim@animwidth{% - \vrule width \z@ height \@anim@animheight depth \@anim@animdepth% - \expandafter\@anim@insertfrmcontent\@anim@tmpvar\@nil% - \hss% - }% - %inside a `landscape' environment together with the icon and widget methods, - %the frame content needs to be rotated counter-clockwise by 90 deg - \ifnum\@anim@method>\@ne\else% - \ifx\@anim@lscape\@anim@@lscape% - \global\setbox\@anim@box=\hbox{\rotatebox{90}{\box\@anim@box}}% +% this counts the length of a clist ,,,..., (note the +% trailing comma) +\def\@anim@countxformlist#1{% + \expandafter\@anim@@countxformlist\expandafter0\expandafter:#1,\@nil% +} +\def\@anim@@countxformlist#1:#2,#3\@nil{% + \ifx\relax#2\relax% + \the\numexpr#1% + \else% + \ifx\relax#3\relax% + \the\numexpr#1% + \else% + \expandafter\@anim@@countxformlist\the\numexpr #1+1:#3\@nil% + \fi% + \fi% +} + +\def\@anim@zaptrailingcommafromxref#1,\@nil{\if@anim@dvips{#1}\else#1\fi}% + +% inserts one animation frame into the output acc. to \ifcase\@anim@method +% as a non-interactive Widget annotation (0 or 1) or an an xform (2) that is +% referenced in the page content (and tagged as OCG or for multipage PDF export) +% args: #1 animation num, #2 frame number, #3 comma-separated list of xform +% refs (transparencies) +\def\@anim@makeframe#1#2#3{% + \edef\@anim@arg{#3}% + \setboolean{@anim@singleref}{false}\def\@anim@framexform{}% + % count number of xforms in the frame content; a single xform can be referenced + % at once, while a transparency list (multiple, overlayed xforms) must be boxed + % and nested in an additional xform + \ifnum\@anim@countxformlist{\@anim@arg}=\@ne% + \setboolean{@anim@singleref}{true}% + \edef\@anim@framexform{\expandafter\@anim@zaptrailingcommafromxref\@anim@arg\@nil}% + \fi% + % however, this isn't possible on landscape pages with \@anim@method==0|1 + % because frame content needs to be rotated by 90 deg counterclockwise + \ifnum\@anim@method>\@ne\else\ifx\@anim@lscape\@anim@@lscape% + \setboolean{@anim@singleref}{false}\def\@anim@framexform{}% + \fi\fi% + % ... nor if the animation is to be exported to multipage PDF + \if@anim@export% + \setboolean{@anim@singleref}{false}\def\@anim@framexform{}% + \fi% + \if@anim@singleref\else% + % put frame content in a box if necessary + \setbox\@anim@box=\hbox to \@anim@animwidth{% + \vrule width \z@ height \@anim@animheight depth \@anim@animdepth% + \expandafter\@anim@refxformlist\@anim@arg,\@nil% + \hss% + }% + % rotate content on lscape pages + \ifnum\@anim@method>\@ne\else% + \ifx\@anim@lscape\@anim@@lscape% + \setbox\@anim@box=\hbox{\rotatebox{90}{\box\@anim@box}}% + \fi% + \fi% + % convert it to an xform + \if@anim@export\else% + \@anim@xform{0}{1}{}{}{\@anim@box}% + \let\@anim@framexform\@anim@lastxform% \fi% \fi% \ifcase\@anim@method% icon based - \@anim@xform{0}{1}{}{}{\@anim@box}% %initial visibility \ifnum\@anim@poster>\@anim@mtwo\relax% insert poster frame \ifnum#2=\@anim@poster\relax% - \let\@anim@posterap\@anim@lastxform% + \let\@anim@posterap\@anim@framexform% \else% \ifnum\@anim@poster=\@anim@mone\relax% use last frame as poster - \let\@anim@posterap\@anim@lastxform% + \let\@anim@posterap\@anim@framexform% \fi% \fi% \fi% @@ -490,8 +524,9 @@ /F 2% /FT/Btn/Ff 65537% /BS <>% - /AP <>% - /MK <>>>% + /AP <>% + /MK <>>>% /T (#1.#2)% }% \or% widget based @@ -512,20 +547,22 @@ \fi% \fi% %frame insertion - \@anim@xform{0}{1}{}{}{\@anim@box}% \@anim@widget{\@anim@animwidth}{\@anim@animheight}{\@anim@animdepth}{% /Subtype/Widget% \@anim@annotflag% /FT/Btn/Ff 65537% /BS <>% - /AP <>% - /MK <>>>% + /AP <>% + /MK <>>>% /T (#1.#2)% }% - \or% ocg based (abused for dvisvgm backend as well as for + \or% ocg-based (abused for dvisvgm backend as well as for % multipage PDF export) \if@anim@export% + \if@anim@insideexport\else\anim@export\fi% \box\@anim@box% + \endanim@export% \else% \@anim@newocg{#1}{#2}% %initial visibility @@ -542,25 +579,13 @@ \fi% \fi% %frame insertion - \if@anim@dvisvgm% - % `marked content' method for dvisvgm - \@anim@xform{0}{0}{}{}{\@anim@box}% - \ocgbase@oc@bdc{\@anim@curocg}% - \@anim@refxform{\@anim@lastxform}% - \ocgbase@oc@emc% - \else% - % /OC method for PDF output - \@anim@xform{0}{0}{}{/OC \@anim@curocg}{\@anim@box}% - \@anim@refxform{\@anim@lastxform}% - %% `marked content' method (slower, perhaps) - %\@anim@xform{0}{0}{}{}{\@anim@box}% - %\ocgbase@oc@bdc{\@anim@curocg}% - %\@anim@refxform{\@anim@lastxform}% - %\ocgbase@oc@emc% - \fi% + \ocgbase@oc@bdc{\@anim@curocg}% + \@anim@refxform{\@anim@framexform}% + \ocgbase@oc@emc% \fi% \fi% } +\newboolean{@anim@singleref} %create XObjects of all button faces \ifnum\if@anim@dvips 1\else\if@anim@dvisvgm 1\else0\fi\fi=1 @@ -843,7 +868,7 @@ \@anim@xbutton{ResetFG}{\@anim@btnreset}{#2}% \endgroup% \ifx\empty\@anim@bg\empty\else% - \global\setbox\@anim@box=\hbox to \@anim@btnsize {% + \setbox\@anim@box=\hbox to \@anim@btnsize {% \vbox to \@anim@btnsize {\vss% \@anim@refxform{\@anim@getkeyval{btnResetBG:#2}}% \@anim@refxform{\@anim@lastxform}% @@ -878,7 +903,7 @@ \def\@anim@xbutton#1#2#3{% #1: name; #2: stroking commands, % only create if button face doesn't exist yet \ifcsname btn#1:#3\endcsname\else% #3: current colour+alpha+ ... combination - \global\setbox\@anim@box=\hbox to 15bp {\vbox to 15bp {\vss% + \setbox\@anim@box=\hbox to 15bp {\vbox to 15bp {\vss% \@anim@literal{}{% save \ifx\empty\@anim@alpha\empty% @@ -909,7 +934,7 @@ }% }\hss}% \if@anim@dvisvgm% - \global\setbox\@anim@box=\hbox{% + \setbox\@anim@box=\hbox{% \resizebox*{!}{\@anim@btnsize}{\box\@anim@box}}% \fi% %distill box into XObject @@ -1607,23 +1632,22 @@ \fi% \if@anim@dvisvgm% \def\@anim@method{\tw@}% using ocg-like method for dvisvgm - \setboolean{@anim@doscaling}{false}% \fi% \if@anim@draft% \if@anim@multipage% %store file in a box - \@anim@filebox{\@anim@pathtofile}{\@anim@first}{\@anim@gropts}% + \@anim@filebox{\@anim@pathtofile}{\@anim@first}{\@anim@gropts}{\@anim@box}% \else% %get file name extension \@anim@getpath{\@anim@base\@anim@first}{\@anim@ftype}% - \@anim@filebox{\@anim@pathtofile}{1}{\@anim@gropts}% + \@anim@filebox{\@anim@pathtofile}{1}{\@anim@gropts}{\@anim@box}% \fi% \@anim@scale{\@anim@box}% %draw draftbox according to dimensions of the first frame \@anim@draftbox% \else% \xdef\@anim@nfps{#2\space}% current frame rate - \xdef\@anim@nfps{\expandafter\zap@space\@anim@nfps\@empty}% + \xdef\@anim@nfps{\expandafter\@anim@zap@space\@anim@nfps\@empty}% \ifdim\@anim@nfps pt<\z@% \PackageError{animate}{% Negative frame rate `\@anim@nfps' is not allowed% @@ -1631,19 +1655,11 @@ \fi% \global\let\@anim@fps\@anim@nfps% % - \if@anim@export\if@anim@timeline% + \if@anim@export% \anim@export% - \fi\fi% - %make all frames of the sequence - \if@anim@dvisvgm\if@anim@timeline\else% - \ifcsname a\the\@anim@num.htbp\endcsname% - \@anim@beginsvgclip{\the\@anim@num}% - \fi% - \fi\fi% + \fi% + %embed content (graphics sequence) \loop\ifnum\@anim@curframe\@anim@relop\@anim@last\relax\else% - \if@anim@export\if@anim@timeline\else% - \anim@export% - \fi\fi% \if@anim@multipage% %embed graphics \@anim@ximage{\the\@anim@num}{\the\@anim@curframe@zb}{% @@ -1657,31 +1673,31 @@ \@anim@ximage{\the\@anim@num}{\the\@anim@curframe@zb}{% \@anim@pathtofile}{1}{\@anim@gropts}% \fi% - \if@anim@export\if@anim@timeline\else% - \endanim@export% - \fi\fi% \global\advance\@anim@curframe by \@anim@every% \global\advance\@anim@curframe@zb by \@ne% \repeat% - \if@anim@dvisvgm\if@anim@timeline\else% - \ifcsname a\the\@anim@num.htbp\endcsname% - \@anim@endsvgclip% - \fi% - \fi\fi% \xdef\@anim@frames{\the\@anim@curframe@zb}% total number \global\@anim@tmpcnt=\@anim@frames% \global\advance\@anim@tmpcnt by -\@ne% \xdef\@anim@maxframe{\the\@anim@tmpcnt}% highest frame index - %build timeline from optional timeline file - \if@anim@timeline% - \if@anim@dvisvgm\ifcsname a\the\@anim@num.htbp\endcsname% - \@anim@beginsvgclip{\the\@anim@num}% - \fi\fi% + %make animation frames from embedded content ... + \if@anim@dvisvgm\ifcsname a\the\@anim@num.htbp\endcsname% + \@anim@beginsvgclip{\the\@anim@num}% + \fi\fi% + \if@anim@timeline% ... by building timeline (optional timeline file) \@anim@buildtmln{\the\@anim@num}% - \if@anim@dvisvgm\ifcsname a\the\@anim@num.htbp\endcsname% - \@anim@endsvgclip% - \fi\fi% + \else% ... or by direct insertion + \global\@anim@curframe@zb=\z@% + \whiledo{\@anim@curframe@zb<\@anim@frames}{% + \@anim@makeframe{\the\@anim@num}{\the\@anim@curframe@zb}{% + \@anim@getkeyval{img@\the\@anim@curframe@zb},% + }% + \global\advance\@anim@curframe@zb by \@ne% + }% \fi% + \if@anim@dvisvgm\ifcsname a\the\@anim@num.htbp\endcsname% + \@anim@endsvgclip% + \fi\fi% % if last frame used as poster, write frame num to aux file \ifnum\@anim@poster=\@anim@mone\relax% \@anim@keytoaux{a\the\@anim@num.poster}{\@anim@maxframe}% @@ -1776,9 +1792,6 @@ \newcount\@anim@resizeflags% resizing flags according to options given. -%post-scaling, not possible for embedded files with dvisvgm -\newboolean{@anim@doscaling} - %set animation widget dimensions \def\@anim@scale#1{% #1: box number \begingroup% @@ -1796,11 +1809,11 @@ %now resize \ifcase\@anim@resizeflags% bit 2^2=width, 2^1=height, 2^0=totalhight given \or% 1 - \global\setbox#1=\hbox{\resizebox*{!}{\@anim@animtotalheight}{\box#1}}% + \setbox#1=\hbox{\resizebox*{!}{\@anim@animtotalheight}{\box#1}}% \or% 2 - \global\setbox#1=\hbox{\resizebox{!}{\@anim@animheight}{\box#1}}% + \setbox#1=\hbox{\resizebox{!}{\@anim@animheight}{\box#1}}% \or\or% 4 - \global\setbox#1=\hbox{\resizebox{\@anim@animwidth}{!}{\box#1}}% + \setbox#1=\hbox{\resizebox{\@anim@animwidth}{!}{\box#1}}% \or% 5 \if@anim@iso% \setlength{\@anim@tmpdima}{% @@ -1809,13 +1822,13 @@ \setlength{\@anim@tmpdimb}{\@anim@animtotalheight}% \ifdim\@anim@tmpdimb<\z@\@anim@tmpdimb=-\@anim@tmpdimb\fi% \ifdim\@anim@tmpdima<\@anim@tmpdimb% - \global\setbox#1=\hbox{\resizebox*{\@anim@animwidth}{!}{\box#1}}% + \setbox#1=\hbox{\resizebox*{\@anim@animwidth}{!}{\box#1}}% \else% - \global\setbox#1=\hbox{% + \setbox#1=\hbox{% \resizebox*{!}{\@anim@animtotalheight}{\box#1}}% \fi% \else% - \global\setbox#1=\hbox{% + \setbox#1=\hbox{% \resizebox*{\@anim@animwidth}{\@anim@totheightarg}{\box#1}}% \fi% \or% 6 @@ -1825,18 +1838,18 @@ \setlength{\@anim@tmpdimb}{\@anim@animheight}% \ifdim\@anim@tmpdimb<\z@\@anim@tmpdimb=-\@anim@tmpdimb\fi% \ifdim\@anim@tmpdima<\@anim@tmpdimb% - \global\setbox#1=\hbox{\resizebox{\@anim@animwidth}{!}{\box#1}}% + \setbox#1=\hbox{\resizebox{\@anim@animwidth}{!}{\box#1}}% \else% - \global\setbox#1=\hbox{\resizebox{!}{\@anim@animheight}{\box#1}}% + \setbox#1=\hbox{\resizebox{!}{\@anim@animheight}{\box#1}}% \fi% \else% - \global\setbox#1=\hbox{% + \setbox#1=\hbox{% \resizebox{\@anim@animwidth}{\@anim@animheight}{\box#1}}% \fi% \fi% %apply scale \ifdim\@anim@boxscale pt=\p@\else% - \global\setbox#1=\hbox{\scalebox{\@anim@boxscale}{\box#1}}% + \setbox#1=\hbox{\scalebox{\@anim@boxscale}{\box#1}}% \fi% %dimensions after resizing \xdef\@anim@animwidth{\the\wd#1}% @@ -1886,7 +1899,7 @@ \ifnum\@anim@poster=\@anim@mtwo\relax% \ifdefined\@anim@apdummy\else% empty appearance widget \setbox\@anim@box=\hbox{\phantom{x}}% - \@anim@xform{0}{0}{}{}{\@anim@box}% + \@anim@xform{0}{1}{}{}{\@anim@box}% \global\let\@anim@apdummy\@anim@lastxform% \@anim@widget{1ex}{1ex}{\z@}{% /Subtype/Widget% @@ -1905,7 +1918,7 @@ \else% \ifdefined\@anim@apdummy\else% empty appearance dummy \setbox\@anim@box=\hbox{\phantom{x}}% - \@anim@xform{0}{0}{}{}{\@anim@box}% + \@anim@xform{0}{1}{}{}{\@anim@box}% \global\let\@anim@apdummy\@anim@lastxform% \fi% \def\@anim@apmk{\@anim@apdummy}% @@ -2015,7 +2028,7 @@ \if@anim@mk\else% \ifdefined\@anim@apdummy\else% empty appearance dummy \setbox\@anim@box=\hbox{\phantom{x}}% - \@anim@xform{0}{0}{}{}{\@anim@box}% + \@anim@xform{0}{1}{}{}{\@anim@box}% \global\let\@anim@apdummy\@anim@lastxform% \fi% \fi% @@ -2119,43 +2132,41 @@ \xdef\@anim@nfps{-1}% \@anim@processfpsarg{#2}% \fi% - \if@anim@export\if@anim@timeline% + \if@anim@export% \anim@export% - \fi\fi% + \fi% \fi% \let\newframe\@anim@@newframe% \let\multiframe\@anim@multiframe% - \if@anim@dvisvgm\if@anim@timeline\else\if@anim@draft\else% - \ifcsname a\the\@anim@num.htbp\endcsname% - \@anim@beginsvgclip{\the\@anim@num}% - \fi% - \fi\fi\fi% \@anim@beginframe% \ignorespaces% }{% \unskip% \@anim@endframe{\the\@anim@num}{\the\@anim@curframe@zb}% - \if@anim@dvisvgm\if@anim@timeline\else\if@anim@draft\else% - \ifcsname a\the\@anim@num.htbp\endcsname% - \@anim@endsvgclip% - \fi% - \fi\fi\fi% \global\advance\@anim@curframe@zb by \@ne% \if@anim@draft\else% \xdef\@anim@frames{\the\@anim@curframe@zb}% total number \global\@anim@tmpcnt=\@anim@frames% \global\advance\@anim@tmpcnt by -\@ne% \xdef\@anim@maxframe{\the\@anim@tmpcnt}% highest frame index - %build timeline from optional timeline file - \if@anim@timeline% - \if@anim@dvisvgm\ifcsname a\the\@anim@num.htbp\endcsname% - \@anim@beginsvgclip{\the\@anim@num}% - \fi\fi% + %make animation frames from embedded content ... + \if@anim@dvisvgm\ifcsname a\the\@anim@num.htbp\endcsname% + \@anim@beginsvgclip{\the\@anim@num}% + \fi\fi% + \if@anim@timeline% ... by building timeline (optional timeline file) \@anim@buildtmln{\the\@anim@num}% - \if@anim@dvisvgm\ifcsname a\the\@anim@num.htbp\endcsname% - \@anim@endsvgclip% - \fi\fi% + \else% ... or by direct insertion + \global\@anim@curframe@zb=\z@% + \whiledo{\@anim@curframe@zb<\@anim@frames}{% + \@anim@makeframe{\the\@anim@num}{\the\@anim@curframe@zb}{% + \@anim@getkeyval{img@\the\@anim@curframe@zb},% + }% + \global\advance\@anim@curframe@zb by \@ne% + }% \fi% + \if@anim@dvisvgm\ifcsname a\the\@anim@num.htbp\endcsname% + \@anim@endsvgclip% + \fi\fi% %insert animation widget & controls \if@anim@export\else% % insert