summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/animate
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-04-26 03:02:41 +0000
committerNorbert Preining <norbert@preining.info>2020-04-26 03:02:41 +0000
commit7d9d2e08fcab92adcc759e3f1e4bb0a15a63f220 (patch)
tree8b20347f7722711d9a3577782906d96684424c9a /macros/latex/contrib/animate
parent7a7be7eaa67109eac37916ea48662c24ddc570d0 (diff)
CTAN sync 202004260302
Diffstat (limited to 'macros/latex/contrib/animate')
-rw-r--r--macros/latex/contrib/animate/ChangeLog8
-rw-r--r--macros/latex/contrib/animate/README.md35
-rw-r--r--macros/latex/contrib/animate/animate.pdfbin3909427 -> 3911070 bytes
-rw-r--r--macros/latex/contrib/animate/animate.sty134
-rw-r--r--macros/latex/contrib/animate/animate.tex89
5 files changed, 161 insertions, 105 deletions
diff --git a/macros/latex/contrib/animate/ChangeLog b/macros/latex/contrib/animate/ChangeLog
index 44a258a0da..66592c1bb6 100644
--- a/macros/latex/contrib/animate/ChangeLog
+++ b/macros/latex/contrib/animate/ChangeLog
@@ -1,3 +1,11 @@
+2020-04-25
+ * fix: compilation error in case of `dvisvgm' + [french]{babel}. For
+ slightly better performance, \animategraphics doesn't pass `clip' anymore
+ automatically to graphicx' \includegraphics; instead, the new `clip'
+ pkg/command option should be set if need be (mostly when using dvisvgm
+ together with trimming options). Interaction with animation on mobile
+ devices: single tap for play/pause
+
2020-03-25
* fix: using `controlsaligned' as package option
diff --git a/macros/latex/contrib/animate/README.md b/macros/latex/contrib/animate/README.md
index b91efeaad2..e9af5c9f3b 100644
--- a/macros/latex/contrib/animate/README.md
+++ b/macros/latex/contrib/animate/README.md
@@ -26,11 +26,16 @@ Note, this file only gives a summary of usage and available package and command
````
width=<h-size>, height=<v-size>, totalheight=<v-size>,
-keepaspectratio, scale=<factor>, nomouse,
-hiresbb,pagebox,interpolate,
-autopause, autoplay, autoresume, controls[=all | none | ...],
+keepaspectratio, scale=<factor>,
+bb=<llx> <lly> <urx> <ury>,
+viewport=<llx> <lly> <urx> <ury>,
+trim=<left> <bottom> <right> <top>,
+clip, hiresbb, pagebox=..., interpolate,
+type=[<file ext>],
+final, draft, nomouse,
+autopause, autoplay, autoresume,
+controls[=all | none | ...],
controlsaligned=left[+<indent>] | center | right[+<indent>],
-final, draft,
buttonsize=<size>,
buttonbg=<colour>, buttonfg=<colour>, buttonalpha=<opacity>,
loop, palindrome, step,
@@ -38,7 +43,6 @@ poster[=first | <num> | last | none],
alttext=none | {<alternative description>},
method=icon | widget | ocg,
dvipdfmx, dvisvgm, xetex,
-type=[<file ext>],
export
````
@@ -64,21 +68,26 @@ export
````
width=<h-size>, height=<v-size>, totalheight=<v-size>,
-keepaspectratio, scale=<factor>, nomouse,
-hiresbb,pagebox,interpolate,
-autopause, autoplay, autoresume, final, draft,
+keepaspectratio, scale=<factor>,
+bb=<llx> <lly> <urx> <ury>,
+viewport=<llx> <lly> <urx> <ury>,
+trim=<left> <bottom> <right> <top>,
+clip, hiresbb, pagebox=..., interpolate,
+type=[<file ext>],
+final, draft, nomouse,
+autopause, autoplay, autoresume,
controls[=all | none | ...],
+controlsaligned=left[+<indent>] | center | right[+<indent>],
buttonsize=<size>,
buttonbg=<colour>, buttonfg=<colour>, buttonalpha=<opacity>,
-loop, palindrome, step, measure,
+loop, palindrome, step,
+measure,
poster[=first | <num> | last | none],
+alttext=none | {<alternative description>},
begin={<begin text>}, end={<end text>},
timeline=<timeline file>,
method=icon | widget | ocg,
-every=<number>, bb=<llx> <lly> <urx> <ury>,
-viewport=<llx> <lly> <urx> <ury>,
-trim=<left> <bottom> <right> <top>,
-label=<label text>, type=[<file ext>]
+every=<number>, label=<label text>
````
## Requirements
diff --git a/macros/latex/contrib/animate/animate.pdf b/macros/latex/contrib/animate/animate.pdf
index b404cbf505..75dad51500 100644
--- a/macros/latex/contrib/animate/animate.pdf
+++ b/macros/latex/contrib/animate/animate.pdf
Binary files differ
diff --git a/macros/latex/contrib/animate/animate.sty b/macros/latex/contrib/animate/animate.sty
index 75fca7a6a4..b4e05000ab 100644
--- a/macros/latex/contrib/animate/animate.sty
+++ b/macros/latex/contrib/animate/animate.sty
@@ -13,7 +13,7 @@
\NeedsTeXFormat{LaTeX2e}
-\def\@anim@version{2020/03/25}
+\def\@anim@version{2020/04/25}
\ProvidesPackage{animate}
[\@anim@version\space PDF & SVG animations from files and inline graphics]
@@ -104,7 +104,7 @@
\endlinechar`\:% `:' appended to every line read
\IfFileExists{#1.xbb}{%
%read from xbb file
- {\catcode`\%=0\sbox0{\input{#1.xbb}}}%
+ {\catcode`\:=12\catcode`\%=0\sbox0{\input{#1.xbb}}}%
\ifdefined#3\else%
\PackageError{animate}{%
Cannot read number of pages from file\MessageBreak%
@@ -118,23 +118,22 @@
%read from command pipe (`extractbb')
%firstly, check whether reading from pipe is allowed
\immediate\closein\@inputcheck%
- \immediate\openin\@inputcheck="|extractbb -h"%
- \let\@anim@foo\@anim@bar% <-- needed for some reason to make
- \ifeof\@inputcheck% <-- this test work correctly
+ \immediate\openin\@inputcheck="|extractbb -h"\relax%
+ \ifeof\@inputcheck%
\immediate\closein\@inputcheck%
\PackageError{animate}{%
Cannot determine number of pages in file\MessageBreak%
----------------------------------------\MessageBreak%
#1.#2\MessageBreak%
----------------------------------------\MessageBreak%
- Try --shell-escape option (--enable-pipes in MikTeX),%
+ Try --shell-escape option (--enable-pipes in MiKTeX),%
\MessageBreak or run\MessageBreak%
\space\space extractbb #1.#2\MessageBreak%
on the command line to provide a valid `xbb' file%
}{}%
\else%
\immediate\closein\@inputcheck%
- {\catcode`\%=0\sbox0{\@@input "|extractbb -O #1.#2"}}%
+ {\catcode`\:=12\catcode`\%=0\sbox0{\@@input "|extractbb -O #1.#2"}}%
\fi%
}%
}}
@@ -349,14 +348,14 @@
%helper macro that typesets graphics file into savebox
\if@anim@dvips
\def\@anim@filebox#1#2{% dvips: no multi-page support
- \edef\@anim@curfile{[clip\@anim@gropts]{#1}}%
+ \edef\@anim@curfile{[\@anim@gropts]{#1}}%
\global\setbox\@anim@box=\hbox{%
\expandafter\includegraphics\@anim@curfile}%
}
\else
%pdfTeX, LuaTeX, dvipdfmx, xetex, dvisvgm
\def\@anim@filebox#1#2{%
- \edef\@anim@curfile{[clip\@anim@gropts,page=#2]{#1}}%
+ \edef\@anim@curfile{[\@anim@gropts,page=#2]{#1}}%
\global\setbox\@anim@box=\hbox{%
\expandafter\includegraphics\@anim@curfile}%
}
@@ -398,7 +397,8 @@
\gdef\@anim@boxscale{\@ne}%
%append final dims to inclusion opts, also used for the remaining files
%of the current animation
- \xdef\@anim@gropts{\@anim@gropts,width=\@anim@animwidth%
+ \xdef\@anim@gropts{\@anim@gropts%
+ \ifx\@anim@gropts\@empty\else,\fi width=\@anim@animwidth%
,height=\@anim@animheight,totalheight=\@anim@animtotalheight}%
\fi%
\fi%
@@ -1535,10 +1535,22 @@
\ifnum\@anim@resizeflags=7\relax% height+totalheight+width->totalheight+width
\global\@anim@resizeflags=5%
\fi%
- \if@anim@hiresbb\xdef\@anim@gropts{\@anim@gropts,hiresbb}\fi%
- \if@anim@interpolate\xdef\@anim@gropts{\@anim@gropts,interpolate}\fi%
- \ifx\@anim@pagebox\@empty\else%
- \xdef\@anim@gropts{\@anim@gropts,pagebox=\@anim@pagebox}\fi%
+ \ifx\@anim@bb\@empty\else\xdef\@anim@gropts{\@anim@gropts%
+ \ifx\@anim@gropts\@empty\else,\fi\@anim@bb}\fi%
+ \ifx\@anim@viewport\@empty\else\xdef\@anim@gropts{\@anim@gropts%
+ \ifx\@anim@gropts\@empty\else,\fi\@anim@viewport}\fi%
+ \ifx\@anim@trim\@empty\else\xdef\@anim@gropts{\@anim@gropts%
+ \ifx\@anim@gropts\@empty\else,\fi\@anim@trim}\fi%
+ \ifx\@anim@angle\@empty\else\xdef\@anim@gropts{\@anim@gropts%
+ \ifx\@anim@gropts\@empty\else,\fi\@anim@angle}\fi%
+ \if@anim@clip\xdef\@anim@gropts{\@anim@gropts%
+ \ifx\@anim@gropts\@empty\else,\fi clip}\fi%
+ \if@anim@hiresbb\xdef\@anim@gropts{\@anim@gropts%
+ \ifx\@anim@gropts\@empty\else,\fi hiresbb}\fi%
+ \if@anim@interpolate\xdef\@anim@gropts{\@anim@gropts%
+ \ifx\@anim@gropts\@empty\else,\fi interpolate}\fi%
+ \ifx\@anim@pagebox\@empty\else\xdef\@anim@gropts{\@anim@gropts%
+ \ifx\@anim@gropts\@empty\else,\fi\@anim@pagebox}\fi%
\ifthenelse{\boolean{@anim@autoplay}\OR\boolean{@anim@autoresume}}{%
\setboolean{@anim@autoplayorresume}{true}%
}{}%
@@ -2790,6 +2802,22 @@
\define@key{anim@user}{keepaspectratio}[true]{%
\setboolean{@anim@iso}{#1}%
}
+\define@key{anim@user}{bb}{%
+ \xdef\@anim@bb{bb=#1}%
+}
+\define@key{anim@user}{viewport}{%
+ \xdef\@anim@viewport{viewport=#1}%
+}
+\define@key{anim@user}{trim}{%
+ \xdef\@anim@trim{trim=#1}%
+}
+\define@key{anim@user}{angle}{%
+ \xdef\@anim@angle{angle=#1}%
+}
+\newboolean{@anim@clip}
+\define@key{anim@usr}{clip}[true]{%
+ \setboolean{@anim@clip}{#1}%
+}
\newboolean{@anim@hiresbb}
\define@key{anim@user}{hiresbb}[true]{%
\setboolean{@anim@hiresbb}{#1}%
@@ -2799,10 +2827,10 @@
\setboolean{@anim@interpolate}{#1}%
}
\define@key{anim@user}{pagebox}{%
- \gdef\@anim@pagebox{#1}%
+ \xdef\@anim@pagebox{pagebox=#1}%
}
\define@key{anim@user}{scale}{%
- \gdef\@anim@boxscale{#1}%
+ \xdef\@anim@boxscale{#1}%
}
\define@key{anim@user}{buttonsize}{%
\gdef\@anim@btnsize{#1}%
@@ -2946,7 +2974,7 @@
\newboolean{@anim@ctrlright}
\newboolean{@anim@ctrlcentre}
\define@key{anim@user}{controlsaligned}{%
- \@anim@parse@ctrlsalignarg\@anim@tmpvar\@anim@tmpdima#1+\@nil%
+ \@anim@parse@ctrlsalignarg\@anim@tmpvar\@anim@tmpdima#1+\@nil%
\ifthenelse{\equal{\@anim@tmpvar}{left}}{%
\setboolean{@anim@ctrlleft}{true}%
\setboolean{@anim@ctrlright}{false}%
@@ -3063,18 +3091,6 @@
\define@key{anim@user}{every}{% embed every #1th frame
\ifnum#1<\@ne\relax\gdef\@anim@every{1}\else\gdef\@anim@every{#1}\fi%
}
-\define@key{anim@user}{bb}{%
- \g@addto@macro\@anim@gropts{, bb=#1}%
-}
-\define@key{anim@user}{viewport}{%
- \g@addto@macro\@anim@gropts{, viewport=#1}%
-}
-\define@key{anim@user}{trim}{%
- \g@addto@macro\@anim@gropts{, trim=#1}%
-}
-\define@key{anim@user}{angle}{%
- \g@addto@macro\@anim@gropts{, angle=#1}%
-}
\newboolean{@anim@meas}
\define@key{anim@user}{measure}[true]{%
\setboolean{@anim@meas}{#1}%
@@ -3107,6 +3123,11 @@
\setboolean{@anim@doscaling}{true}%
\global\let\@anim@boxscale\@anim@@boxscale%
\global\let\if@anim@iso=\if@anim@@iso%
+ \global\let\@anim@bb\@anim@@bb%
+ \global\let\@anim@viewport\@anim@@viewport%
+ \global\let\@anim@trim\@anim@@trim%
+ \global\let\@anim@angle\@anim@@angle%
+ \global\let\if@anim@clip=\if@anim@@clip%
\global\let\if@anim@hiresbb=\if@anim@@hiresbb%
\global\let\if@anim@interpolate=\if@anim@@interpolate%
\global\let\@anim@pagebox\@anim@@pagebox%
@@ -3308,6 +3329,26 @@
\define@key{anim@pkg}{keepaspectratio}[true]{%
\setboolean{@anim@@iso}{#1}%
}
+\def\@anim@@bb{}
+\define@key{anim@pkg}{bb}{%
+ \xdef\@anim@bb{bb=#1}%
+}
+\def\@anim@@viewport{}
+\define@key{anim@pkg}{viewport}{%
+ \xdef\@anim@@viewport{viewport=#1}%
+}
+\def\@anim@@trim{}
+\define@key{anim@pkg}{trim}{%
+ \xdef\@anim@@trim{trim=#1}%
+}
+\def\@anim@@angle{}
+\define@key{anim@pkg}{angle}{%
+ \xdef\@anim@@angle{angle=#1}%
+}
+\newboolean{@anim@@clip}
+\define@key{anim@pkg}{clip}[true]{%
+ \setboolean{@anim@@clip}{#1}%
+}
\newboolean{@anim@@hiresbb}
\define@key{anim@pkg}{hiresbb}[true]{%
\setboolean{@anim@@hiresbb}{#1}%
@@ -3318,7 +3359,7 @@
}
\def\@anim@@pagebox{}
\define@key{anim@pkg}{pagebox}{%
- \def\@anim@@pagebox{#1}%
+ \xdef\@anim@@pagebox{pagebox=#1}%
}
\def\@anim@@boxscale{1}%
\define@key{anim@pkg}{scale}{%
@@ -3389,7 +3430,7 @@
\setboolean{@anim@@ctrlcentre}{true}
\def\@anim@@ctrlsindent{\z@}
\define@key{anim@pkg}{controlsaligned}{%
- \@anim@parse@ctrlsalignarg\@anim@tmpvar\@anim@tmpdima#1+\@nil%
+ \@anim@parse@ctrlsalignarg\@anim@tmpvar\@anim@tmpdima#1+\@nil%
\setboolean{@anim@@ctrlcentre}{false}%
\ifthenelse{\equal{\@anim@tmpvar}{left}}{%
\setboolean{@anim@@ctrlleft}{true}%
@@ -3569,7 +3610,7 @@
\if@anim@controls@play%
var a#1_btnPauseLeft,a#1_btnPlayLeft,a#1_btnPauseRight,a#1_btnPlayRight;$%
\fi%
- var a#1_playsRight,a#1_isPaused;$%
+ var a#1_playsRight,a#1_isPaused\if@anim@step\else,a#1_playing\fi;$%
\if@anim@step\else
var a#1_int;$% timer id (takes return val of setIntervall())
% function pointers
@@ -4228,7 +4269,7 @@
\@anim@@jsvardecls{#1}% variables that are supposed to be global
(function(){$% IIFE (self-executing anon. function) to limit scope
function onload(){$%
- \@anim@@jsinit{#1}%
+ \@anim@@jsinit{#1}$%
\if@anim@nomouse\else
document.getElementById('anm#1').addEventListener('mouseup',%
onMouseUpWdgt);$%
@@ -4236,10 +4277,6 @@
onMouseDownWdgt);$%
document.getElementById('anm#1').addEventListener('touchend',%
onTouchEndWdgt);$%
- document.getElementById('anm#1').addEventListener('touchstart',%
- onTouchStartWdgt);$%
- document.getElementById('anm#1').addEventListener('touchmove',%
- onTouchMove);$%
\fi%
onvisible();$% in case of `autoplay' option
}$%
@@ -4259,28 +4296,19 @@
document.addEventListener('visibilitychange',onVisibilityChange);$%
window.addEventListener('load',onload);$%
\if@anim@nomouse\else
- var permPause#1=false;
function onWidgetUpAction(event){$%
\@anim@wdgtUpJS{#1}%
}$%
- function onTouchStartWdgt(event){$%
- event.preventDefault();$%
- event.stopPropagation();$%
- permPause#1=false;
- \@anim@wdgtDownJS{#1}%
- }$%
function onTouchEndWdgt(event){$%
event.preventDefault();$%
event.stopPropagation();$%
- if(event.targetTouches.length>0){permPause#1=true;}$%
- else{$%
- if(permPause#1){permPause#1=false;}$%
- else{onWidgetUpAction(event);}$%
- }$%
- }$%
- function onTouchMove(event){$%
- event.preventDefault();$%
- event.stopPropagation();$%
+ \if@anim@step\else
+ if(a#1_playing){try{a#1_pause();}catch(e){}}else{$%
+ \fi%
+ \@anim@wdgtUpJS{#1}%
+ \if@anim@step\else%
+ }$%
+ \fi%
}$%
function onMouseDownWdgt(event){$%
event.preventDefault();$%
diff --git a/macros/latex/contrib/animate/animate.tex b/macros/latex/contrib/animate/animate.tex
index 684d9216df..0249961249 100644
--- a/macros/latex/contrib/animate/animate.tex
+++ b/macros/latex/contrib/animate/animate.tex
@@ -1,11 +1,11 @@
-\ifdefined\outputmode\outputmode=0\fi
-\ifdefined\pdfoutput\pdfoutput=0\fi
% Copyright 2007--\today Alexander Grahn
%
% This material is subject to the LaTeX Project Public License. See
% http://mirrors.ctan.org/macros/latex/base/lppl.txt
% for the details of that license.
%
+\ifdefined\outputmode\outputmode=0\fi
+\ifdefined\pdfoutput\pdfoutput=0\fi
\documentclass[a4paper]{article}
\frenchspacing
\usepackage[buttonbg=0.9]{animate}
@@ -112,13 +112,16 @@
\section{Introduction}
This package provides an interface for creating PDF and SVG files with animated content from sets of graphics or image files, from inline graphics, such as \LaTeX-picture, PSTricks or pgf/TikZ generated pictures, or just from typeset text. Unlike standard movie/video formats, package `animate' allows for animating vector graphics. The result is roughly similar to the SWF (Flash) format, although not as space-efficient.
-Package `animate' supports the usual workflows for making PDF, i.\,e. pdf\LaTeX{}, Lua\LaTeX{}, \LaTeX{} $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+/Distiller and \pXepLaTeX{} $\rightarrow$ \verb+(x)dvipdfmx+. For animated SVG, it supports the \verb+dvisvgm+ driver. The DVI/XDV used as input for \verb+dvisvgm+ can be generated with \LaTeX{}, Lua\LaTeX{} (in DVI mode) and \XeLaTeX.
+Package `animate' supports the usual workflows for making PDF, i.\,e. pdf\LaTeX{}, Lua\LaTeX{}, \LaTeX{} $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+/Distiller and \pXepLaTeX{} $\rightarrow$ \verb+(x)dvipdfmx+. For animated SVG, it supports the \verb+dvisvgm+ driver. The DVI/XDV used as input for \verb+dvisvgm+ can be generated with \LaTeX{}, Lua\LaTeX{} (in DVI mode with command `\verb+dvilualatex+') and \XeLaTeX{} (with option `\verb+--no-pdf+').
-PDF files with animations can be viewed in Acrobat Reader (except on mobile devices), PDF-XChange and Foxit Reader. Animated SVG produced by means of \LaTeX{} and \verb+dvisvgm+ are self-contained files that can be embedded into HTML using the \verb+<object>+ tag or opened directly in a Web browser, such as Chromium or Firefox.
+PDF files with animations can be viewed in Acrobat Reader (except on mobile devices), PDF-XChange and Foxit Reader.
-The user interacts with the animation through optional animation controls or using the mouse like so: pressing the mouse button over the animation widget immediately pauses a playing animation and releasing it resumes playback. Pressing the shift-key at the same time reverses the playback direction. Keeping the mouse button pressed while moving the mouse pointer off the animation widget permanently pauses playback.
+Animated SVG produced by means of \LaTeX{} and \verb+dvisvgm+ are self-sufficient files that can be embedded into HTML using the \verb+<object>+ tag or opened directly in a Web browser, such as Chromium or Firefox. Also, presentations, such as `beamer'-class documents, with embedded animations can be exported to SVG instead of PDF and viewed in a Web browser. SVG-capable Web browsers are standard on many platforms and operating systems and thus make SVG a very portable file format. A \LaTeX{} package for embedding video and audio into SVG is also available\cite{media4svg}.
+
+The user interacts with the animation through optional animation controls or using the mouse like so: pressing the mouse button over the animation widget immediately pauses a playing animation and releasing it resumes playback. Pressing the shift-key at the same time reverses the playback direction. Keeping the mouse button pressed while moving the mouse pointer off the animation widget permanently pauses playback. On mobile devices, tapping on the animation toggles between play and pause.
+
+%On mobile devices, interaction with an animated SVG is similar to that on desktop devices, just using finger touches instead of mouse button press/release. To permanently pause an animation without the pause button, touch the animation with a second finger, then lift both fingers off.
-On mobile devices, interaction with an animated SVG is similar to that on desktop devices, just using finger touches instead of mouse button press/release. To permanently pause an animation without the pause button, touch the animation with a second finger, then lift both fingers off.
\section{Requirements}
\begin{trivlist}
@@ -129,7 +132,7 @@ On mobile devices, interaction with an animated SVG is similar to that on deskto
\item dvipdfmx, version $\ge 20190503$, for DVI to PDF conversion
\item \verb+dvisvgm+ for DVI to SVG conversion (also requires Ghostscript)
\item PDF: Acrobat Reader, PDF-XChange, Foxit Reader
-\item SVG: Chromium-based browsers, Firefox and others
+\item SVG: Chromium-based browsers for best performance
\end{trivlist}
\section{Installation}
@@ -166,9 +169,13 @@ width=<h-size>
height=<v-size> | totalheight=<v-size>
keepaspectratio
scale=<factor>
+bb=<llx> <lly> <urx> <ury>
+viewport=<llx> <lly> <urx> <ury>
+trim=<left> <bottom> <right> <top>
+clip
hiresbb
interpolate
-pagebox
+pagebox=...
buttonsize=<size>
buttonbg=<colour>
buttonfg=<colour>
@@ -266,9 +273,9 @@ For example, the line
\end{verbatim}
would create an animation from all pages of the file `frames.pdf', running at 12 fps.
-\clearpage
+%\clearpage
\section{Command options}
-The following options to \verb+\animategraphics+ and `\verb+animateinline+' have been provided:
+The following options to \verb+\animategraphics+ and `\verb+animateinline+' have been provided.
\subsection{Basic options}
\begin{verbatim}
label=<label text>
@@ -281,7 +288,7 @@ Overrides the searching procedure for graphics files explained in the previous s
\begin{verbatim}
poster[=first | <num> | last | none]
\end{verbatim}
-Specifies which frame to display and print if the animation is not activated. The first frame is shown by default. Thus `\verb+poster+' or `\verb+poster=first+' need not be explicitly set. A frame number \verb+<num>+ may as well be given; \verb+<num>+ is zero-based, that is, the first frame has number `0'.
+Specifies which frame to display and print if the animation is not activated. The first frame is shown by default. Thus, `\verb+poster+' or `\verb+poster=first+' need not be explicitly set. A frame number \verb+<num>+ may as well be given; \verb+<num>+ is zero-based, that is, the first frame has number `0'.
\begin{verbatim}
every=<num>
\end{verbatim}
@@ -331,9 +338,13 @@ viewport=<llx> <lly> <urx> <ury>
\begin{verbatim}
trim=<left> <bottom> <right> <top>
\end{verbatim}
-(\verb+\animategraphics+ only.) Crops graphics at the edges. The four lengths specify the amount to be removed from or, if negative values have been provided, to be added to each side of the graphics.
+(\verb+\animategraphics+ only.) Crops graphic at the edges. The four lengths specify the amount to be removed from or, if negative values have been provided, to be added to each side of the graphic.
\begin{verbatim}
-pagebox
+clip
+\end{verbatim}
+(\verb+\animategraphics+ only.) Clips the graphic to the (possibly modified) bounding box.
+\begin{verbatim}
+pagebox=...
hiresbb
interpolate
\end{verbatim}
@@ -534,25 +545,7 @@ or
\end{verbatim}
`\verb+anim+' is an array of animation object references. Animations must be labelled using the `\verb+label=...+' command option in order to be present in the `\verb+anim+' array. As usual, properties and methods are accessed via the dot notation. Properties and methods of the animation object are summarized in Tables \ref{tab:props} and \ref{tab:methods}.
-One potential use of the JavaScript interface could be within a timeline file associated with an animation. For example, loops over a sub-range of frames can be programmed by setting the `\verb+frameNum+' property. See Section~\ref{sect:timeline}, p.~\pageref{sect:jsfield} for details.
-
-Also, the programming interface can be used to create custom buttons for playback control. The command \verb+\mediabutton+ from the `media9' package provides a convenient way for achieving this:
-\begin{lstlisting}
- \usepackage{media9}
- \usepackage{animate}
- ...
-
- \animategraphics[label=my_anim]{12}{...}{...}{...}
-
- \mediabutton[
- jsaction={anim['my_anim'].playFwd();}
- ]{\fbox{Play}}
- \mediabutton[
- jsaction={anim['my_anim'].frameNum=5;}
- ]{\fbox{Goto 6th frame}}
-\end{lstlisting}
-
-\begin{table}[p]%[hbp]
+\begin{table}[hbp]%[p]%[hbp]
\centering
\caption{Animation object properties}\label{tab:props}
\begin{tabularx}{\linewidth}[t]{lllX}\hline
@@ -568,7 +561,7 @@ name & type & access & description\\\hline\hline
\end{tabularx}
\end{table}
-\begin{table}[p]%[htbp]
+\begin{table}[htp]%[p]%[htbp]
\centering
\caption{Animation object methods}\label{tab:methods}
\begin{tabularx}{\linewidth}[t]{lX}\hline
@@ -582,6 +575,24 @@ name & description\\\hline\hline
\end{tabularx}
\end{table}
+One potential use of the JavaScript interface could be within a timeline file associated with an animation. For example, loops over a sub-range of frames can be programmed by setting the `\verb+frameNum+' property. See Section~\ref{sect:timeline}, p.~\pageref{sect:jsfield} for details.
+
+Also, the programming interface can be used to create custom buttons for playback control. The command \verb+\mediabutton+ from the `media9' package provides a convenient way for achieving this:
+\begin{lstlisting}
+ \usepackage{media9}
+ \usepackage{animate}
+ ...
+
+ \animategraphics[label=my_anim]{12}{...}{...}{...}
+
+ \mediabutton[
+ jsaction={anim['my_anim'].playFwd();}
+ ]{\fbox{Play}}
+ \mediabutton[
+ jsaction={anim['my_anim'].frameNum=5;}
+ ]{\fbox{Goto 6th frame}}
+\end{lstlisting}
+
\clearpage
\section{Examples}
\subsection{Animations from sets of files, using {\tt\textbackslash animategraphics}}\label{sect:examples}
@@ -1337,17 +1348,16 @@ The following code may serve as a template for generating standalone animated SV
\begin{lstlisting}
\documentclass[dvisvgm]{standalone}
-\usepackage{animate}
-\usepackage{graphicx}
-
%\usepackage{xcolor}
%\pagecolor{white} % opaque background with solid colour
%\usepackage{pstricks} % enable as needed
%\usepackage{tikz}
-\begin{document}
+\usepackage{animate}
+\usepackage{graphicx}
+\begin{document}
%
% \animategraphics{..}{...}{...}{...}
%
@@ -1355,7 +1365,6 @@ The following code may serve as a template for generating standalone animated SV
%
% \begin{animateinline}{..} ... \end{animateinline}
%
-
\end{document}
\end{lstlisting}
Note that when animating external graphics with \verb+\animategraphics+, only PDF and PostScript (EPS, PS, MPS) files are converted to inline SVG code; files in other formats (SVG, PNG, JPEG) remain external and must be bundled with the final SVG output. Thus, for obtaining self-contained SVG, it is recommended to convert PNG, JPEG and SVG files to PDF or PostScript first. Also note that PostScript files must have all required fonts embedded. This is not always the case for \MP-generated PostScript. Here, embedding of fonts is ensured by putting `\verb+prologues := 3;+' into the header of the \MP{} input.
@@ -1455,13 +1464,15 @@ In \TeX4ht documents, the whole \verb+<object>...</object>+ tag can be inserted
\section{Acknowledgements}
I would like to thank François Lafont who discovered quite a few bugs and made many suggestions that helped to improve the functionality of the package. Many thanks to Jin-Hwan Cho, the developer of \verb+dvipdfmx+, for contributing the \verb+dvipdfmx+ specific code, and to Walter Scott for proof-reading the documentation.
+\enlargethispage{4ex}
\begin{thebibliography}{8}
- \bibitem{chupin} Chupin, M.: \emph{Syracuse MetaPost/Animations.} URL: \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\url{http://melusine.eu.org/}} \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\url{syracuse/metapost/animations/chupin/?idsec=scara}}
+\bibitem{chupin} Chupin, M.: \emph{Syracuse MetaPost/Animations.} URL: \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\url{http://melusine.eu.org/}} \href{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}{\url{syracuse/metapost/animations/chupin/?idsec=scara}}
\bibitem{dvisvgm} \emph{dvisvgm: A fast DVI to SVG converter} URL: \url{http://dvisvgm.de}
\bibitem{gilg05} Gilg, J.: PDF-Animationen. In: \emph{Die \TeX nische Kom\"odie}, Issue 4, 2005, pp.~30--37
%\bibitem{hol} Holeček, J.: \emph{Animations in a pdf\TeX-generated PDF}. URL: \url{http://www.fi.muni.cz/~xholecek/tex/pdfanim.xhtml}
\bibitem{hol} Holeček, J.; Sojka, P.: Animations in pdf\TeX-generated PDF. In: \emph{\TeX, XML, and Digital Typography}, Springer, 2004, pp.~179--191. doi:10.1007/978-3-540-27773-6\textunderscore14
\bibitem{luque12} Luque, M.: \emph{PSTricks : applications.} URL: \url{http://pstricks.blogspot.com}
+\bibitem{media4svg} \emph{The media4svg Package}. URL: \url{http://www.ctan.org/pkg/media4svg}
\bibitem{media9} \emph{The media9 Package}. URL: \url{http://www.ctan.org/pkg/media9}
\bibitem{texsx} \emph{Beamer: animate package and overlay}. URL: \href{https://tex.stackexchange.com/a/385209}{\url{https://tex.stackexchange.com}}\\ \href{https://tex.stackexchange.com/a/385209}{\url{/a/385209}}
\end{thebibliography}