texlive[49273] Master/texmf-dist: animate (29nov18)

commits+karl at tug.org commits+karl at tug.org
Fri Nov 30 00:19:27 CET 2018


Revision: 49273
          http://tug.org/svn/texlive?view=revision&revision=49273
Author:   karl
Date:     2018-11-30 00:19:26 +0100 (Fri, 30 Nov 2018)
Log Message:
-----------
animate (29nov18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/animate/ChangeLog
    trunk/Master/texmf-dist/doc/latex/animate/animate.pdf
    trunk/Master/texmf-dist/source/latex/animate/animate.tex
    trunk/Master/texmf-dist/source/latex/animate/files/exp.mp
    trunk/Master/texmf-dist/source/latex/animate/files/scarab.mp
    trunk/Master/texmf-dist/tex/latex/animate/animate.sty

Removed Paths:
-------------
    trunk/Master/texmf-dist/source/latex/animate/files/pstmetronome.tex

Modified: trunk/Master/texmf-dist/doc/latex/animate/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/doc/latex/animate/ChangeLog	2018-11-29 23:14:58 UTC (rev 49272)
+++ trunk/Master/texmf-dist/doc/latex/animate/ChangeLog	2018-11-29 23:19:26 UTC (rev 49273)
@@ -1,3 +1,7 @@
+2018-11-29
+	* fix : SVG usability issues on touch (mobile) devices; documentation
+	updated
+
 2018-11-20
 	* fix : `autoplay' (non-functional in SVG output); documentation
 	updated (additions in section on SVG)

Modified: trunk/Master/texmf-dist/doc/latex/animate/animate.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/animate/animate.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/animate/animate.tex	2018-11-29 23:14:58 UTC (rev 49272)
+++ trunk/Master/texmf-dist/source/latex/animate/animate.tex	2018-11-29 23:19:26 UTC (rev 49273)
@@ -107,12 +107,14 @@
 \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.
+
+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 Firefox or Chromium. 
+
 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.
 
-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+, and \LaTeX{} $\rightarrow$ \verb+dvisvgm+ for SVG.
+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.
 
-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 Firefox or Chromium.
-
 \section{Requirements}
 \begin{trivlist}
 %\item $\varepsilon$-\TeX
@@ -169,7 +171,7 @@
 \end{verbatim}
 Except for `\verb+dvipdfmx+', `\verb+xetex+', `\verb+dvisvgm+' and `\verb+export+', the listed package options are also available (among others) as command options and will be explained shortly. However, if used as package options they have global scope, taking effect on all animations in the document. In turn, command options locally override global settings. Options without an argument are boolean options and can be negated, with the exception of package-only options `\verb+dvipdfmx+', `\verb+xetex+', `\verb+dvisvgm+ and `\verb+export+', by appending `\verb+=false+'.
 
-\begin{animateinline}[autoplay,loop,nomouse]{1}\strut\emph{Important:}\newframe[3]\end{animateinline} Option `\verb+-Ppdf+' should \emph{not} be used with \verb+dvips+ when converting DVI to Postscript. If you cannot do without, put `\verb+-D 1200+' \emph{after} `\verb+-Ppdf+' on the command line. Users of \LaTeX-aware text editors with menu-driven toolchain invocation, such as \TeX{}nicCenter, should check the configuration of the \verb+dvips+ call.
+\begin{animateinline}[autoplay,loop,nomouse]{1}\strut\emph{Important:}\newframe[3]\end{animateinline} Option `\verb+-Ppdf+' should \emph{not} be used with \verb+dvips+ when converting DVI to PostScript. If you cannot do without, put `\verb+-D 1200+' \emph{after} `\verb+-Ppdf+' on the command line. Users of \LaTeX-aware text editors with menu-driven toolchain invocation, such as \TeX{}nicCenter, should check the configuration of the \verb+dvips+ call.
 
 All workflows require the `graphicx' package to be loaded explicitly.
 
@@ -238,7 +240,7 @@
   \animategraphics{12}{frame_}{5}{50}
 \end{verbatim}
 
-The possible file formats depend on the output driver being used. In the case of \LaTeX{} + \verb+dvips+, files with the `eps' extension are at first searched for, followed by `mps' (\MP-generated Postscript) and `ps'. With pdf\LaTeX{} and Lua\LaTeX{} the searching order is: (1)~`pdf', (2)~`mps', (3)~`png', (4)~`jpg', (5)~`jpeg', (6)~`jbig2', (7)~`jb2', (8)~`jp2'\footnotemark[1], (9)~`j2k'\footnotemark[1], (10)~`jpx'\footnotemark[1]\footnotetext[1]{Only Lua\LaTeX{} currently supports JPEG2000.}, with \XeLaTeX{} or \LaTeX{}+\verb+dvipdfmx+: (1)~`pdf', (2)~`mps', (3)~`eps', (4)~`ps', (5)~`png', (6)~`jpg', (7)~`jpeg', (8)~`bmp', and with \LaTeX{}+\verb+dvisvgm+: (1)~`eps', (2)~`ps', (3)~`svg', (4)~`png', (5)~`jpg', (6)~`jpeg'. That is, files capable of storing vector graphics are found first. Make sure that all file names have \emph{lower case} extensions.
+The possible file formats depend on the output driver being used. In the case of \LaTeX{} + \verb+dvips+, files with the `eps' extension are at first searched for, followed by `mps' (\MP-generated PostScript) and `ps'. With pdf\LaTeX{} and Lua\LaTeX{} the searching order is: (1)~`pdf', (2)~`mps', (3)~`png', (4)~`jpg', (5)~`jpeg', (6)~`jbig2', (7)~`jb2', (8)~`jp2'\footnotemark[1], (9)~`j2k'\footnotemark[1], (10)~`jpx'\footnotemark[1]\footnotetext[1]{Only Lua\LaTeX{} currently supports JPEG2000.}, with \XeLaTeX{} or \LaTeX{}+\verb+dvipdfmx+: (1)~`pdf', (2)~`mps', (3)~`eps', (4)~`ps', (5)~`png', (6)~`jpg', (7)~`jpeg', (8)~`bmp', and with \LaTeX{}+\verb+dvisvgm+: (1)~`eps', (2)~`ps', (3)~`mps', (4)~`svg', (5)~`png', (6)~`jpg', (7)~`jpeg'. That is, files capable of storing vector graphics are found first. Make sure that all file names have \emph{lower case} extensions.
 
 This searching procedure can be skipped thanks to the package and command option `\verb+type=<file ext>+'. It enforces the embedding of files with the given file name extension \verb+<file ext>+.
 
@@ -309,7 +311,7 @@
 \begin{verbatim}
 bb=<llx> <lly> <urx> <ury>
 \end{verbatim}
-(\verb+\animategraphics+ only.) The four, space separated arguments set the bounding box of the graphics files. Units can be omitted, in which case `bp' (Postscript points) is assumed.
+(\verb+\animategraphics+ only.) The four, space separated arguments set the bounding box of the graphics files. Units can be omitted, in which case `bp' (PostScript points) is assumed.
 \begin{verbatim}
 viewport=<llx> <lly> <urx> <ury>
 \end{verbatim}
@@ -1122,8 +1124,8 @@
 \psline(! -.1 \psk at oscmetronomed neg)(!0.1 \psk at oscmetronomed neg)\psline(! 0 \psk at oscmetronomed neg 0.1 sub)(!0 \psk at oscmetronomed neg 0.1 add)}
 \pnode(!0 \psk at oscmetronomex){C}% curseur
 \pnode(! 0 \psk at oscmetronomed neg){D}% disque
-\pstextpath[c](0,-2ex){\psarcn[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{m e t r o n o m e}}}
-\pstextpath[c](0,1ex){\psarc[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{P S t r i c k s}}}
+%\pstextpath[c](0,-2ex){\psarcn[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{m e t r o n o m e}}}
+%\pstextpath[c](0,1ex){\psarc[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{P S t r i c k s}}}
   \end at SpecialObj%
 \endgroup}
 \psmetronome%
@@ -1295,13 +1297,13 @@
 \end{lstlisting}
 
 \section{Producing animated SVG} 
-Thanks to Martin Gieseking's `\verb+dvisvgm+' utility~\cite{dvisvgm} that ships with all major \TeX{} distributions, package `animate' can produce self-contained animated SVG, with all the bits and pieces already included that are necessary to run in modern Web browsers as standalone files or as embedded objects within a Web page made of HTML. Animations have the same look and usability, including optional control buttons, as if they were embedded in a PDF document.
+Thanks to Martin Gieseking's `\verb+dvisvgm+' utility~\cite{dvisvgm} that ships with all major \TeX{} distributions, package `animate' can produce self-contained animated SVG, with all the bits and pieces already included that are necessary to run in modern Web browsers as standalone files or as embedded objects within a Web page made of HTML. Animations have the same look and usability, including optional control buttons, as if they were embedded in a PDF document. Animated SVG even work on mobile devices.
 
-Moreover, as `\verb+dvisvgm+' is linked against the Ghostscript library, it can parse and convert embedded Postscript to inline SVG code. It is therefore compatible with the popular TikZ and PSTricks \LaTeX{} packages.
+As `\verb+dvisvgm+' is linked against the Ghostscript library, it can parse and convert embedded PostScript to inline SVG code. It is therefore compatible with the popular TikZ and PSTricks \LaTeX{} packages.
  
-SVG is a one-page graphics format. Therefore, it is most useful to first produce DVI with a single animation per file or page. Then, `\verb+dvisvgm+' converts every page of the DVI input to a standalone SVG file. For a standalone animated SVG, use the `article' document class and pass `\verb+dvisvgm+' as a global option. In this way, it gets conveyed to  `animate' and other packages to be loaded, such as `graphicx' or TikZ. Note that the `standalone' document class is not required; `\verb+dvisvgm+' already computes the tightly enclosing bounding box around the page content by default.
+SVG is a one-page graphics format. Therefore, it is most useful to first produce DVI with a single animation per file or page. Then, `\verb+dvisvgm+' converts every page of the DVI input to a standalone animated SVG file. Use the `article' document class and pass `\verb+dvisvgm+' as a global option. In this way, it gets conveyed to `animate' and other packages to be loaded, such as `graphicx' or TikZ. Note that the `standalone' document class is not required; `\verb+dvisvgm+' already computes the tightly enclosing bounding box around the page content by default.
 
-The following code may serve as a template for generating standalone SVG:
+The following code may serve as a template for generating standalone animated SVG:
 \begin{lstlisting}
 \documentclass[12pt,dvisvgm]{article}
 
@@ -1330,7 +1332,7 @@
 \end{center}
 \end{document}
 \end{lstlisting}
-Note that when animating external graphics with \verb+\animategraphics+, only Postscript (EPS, PS) 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. Unfortunately, the use of (E)PS with \verb+\animategraphics+ is limited to vector graphics. If such files contain bitmapped content they must be converted to PNG (or JPEG, if photographs). Of course, these files remain external to the final animated SVG.
+Note that when animating external graphics with \verb+\animategraphics+, only 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. Also note that PostScript files must have the fonts embedded. This is not always the case for \MP-generated PostScript. Here, embedding of fonts is ensured putting `\verb+prologues := 3+' into the header of the \MP{} input. Unfortunately, animating PostScript files with \verb+\animategraphics+ is limited to vector graphics. If such files contain bitmapped content they must be converted to PNG (or JPEG, if photographs). Of course, these files remain external to the final animated SVG.
 
 Use one of
 \begin{verbatim}
@@ -1341,7 +1343,7 @@
 \end{verbatim}
 to produce DVI or XDV output from the \LaTeX{} source. After this, SVG is obtained by running
 \begin{verbatim}
-dvisvgm --no-fonts -exact
+dvisvgm --no-fonts --exact
 \end{verbatim}
 on the intermediate DVI or XDV file. Option `\verb+--no-fonts+' prompts `\verb+dvisvgm+' to retrace font glyphs as graphical paths. It ensures that the text font looks as in normal PDF output. Option `\verb+--exact+' tells `\verb+dvisvgm+' to calculate exact bounding boxes around font glyphs. This avoids clipping of glyphs in the SVG output, as glyphs usually tend to be slightly bigger than their boxes defined in the font files. To convert multipage DVI/XDV with several animations, add option `\verb+-p1,-+'. By default, `\verb+dvisvgm+' processes only the very first page of the input file. As SVG derives from XML it is not known to be particularly economical in terms of file size. Compressed SVG, with file extension `\verb+svgz+', shortens download times and is supported by most Web browsers. It can be generated by adding option `\verb+-z+'.
 

Modified: trunk/Master/texmf-dist/source/latex/animate/files/exp.mp
===================================================================
--- trunk/Master/texmf-dist/source/latex/animate/files/exp.mp	2018-11-29 23:14:58 UTC (rev 49272)
+++ trunk/Master/texmf-dist/source/latex/animate/files/exp.mp	2018-11-29 23:19:26 UTC (rev 49273)
@@ -1,7 +1,10 @@
 % Jan Holecek, Alexander Grahn
-% 2017/02/27
+% 2018/11/29
 
-filenametemplate "%j_%c.mps";
+prologues:=3;
+outputtemplate := "%j_%c.mps";
+outputformat := "mps";
+
 verbatimtex
 \documentclass{article}
 \usepackage[latin1]{inputenc}

Deleted: trunk/Master/texmf-dist/source/latex/animate/files/pstmetronome.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/animate/files/pstmetronome.tex	2018-11-29 23:14:58 UTC (rev 49272)
+++ trunk/Master/texmf-dist/source/latex/animate/files/pstmetronome.tex	2018-11-29 23:19:26 UTC (rev 49273)
@@ -1,233 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% animated metronome
-% this code is based to 99.9 percent on the work by Manuel Luque
-% (pstricks.blogspot.com)
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\makeatletter
-\pst at addfams{pst-metronome}
-\define at key[psset]{pst-metronome}{theta0}{\def\psk at oscmetronomethetai{#1 }}
-\psset[pst-metronome]{theta0=45} % position initiale du metronome
-\define at key[psset]{pst-metronome}{M}{\def\psk at oscmetronometM{#1 }}
-\psset[pst-metronome]{M=25} % masse du disque en g
-\define at key[psset]{pst-metronome}{m}{\def\psk at oscmetronometm{#1 }}
-\psset[pst-metronome]{m=6} % masse du curseur en g
-\define at key[psset]{pst-metronome}{r}{\def\psk at oscmetronomer{#1 }}
-\psset[pst-metronome]{r=1} % rayon du disque en cm
-\define at key[psset]{pst-metronome}{x}{\def\psk at oscmetronomex{#1 }}
-\psset[pst-metronome]{x=8.4} % position du curseur en cm par rapport \xE0 l'axe
-\define at key[psset]{pst-metronome}{d}{\def\psk at oscmetronomed{#1 }}
-\psset[pst-metronome]{d=3.2} % distance de l'axe au centre du disque en cm
-\define at key[psset]{pst-metronome}{dt}{\def\psk at oscmetronomedt{#1 }}
-\psset[pst-metronome]{dt=0.01} % pas pour RK4
-\define at key[psset]{pst-metronome}{nT}{\def\psk at oscmetronomenT{#1 }}
-\psset[pst-metronome]{nT=1} % nombre de p\xE9riodes repr\xE9sent\xE9es
-%---- calculer theta(t) et thetapoint(t) --------
-\def\psmetronome{\pst at object{psmetronome}}
-\def\psmetronome at i{%
-\begingroup%
-\use at par%
-  \begin at SpecialObj%
-  \pstVerb{%
- /deg2rad {180 div 3.14159 mul} def
- /rad2deg {180 mul 3.14159 div} def
- /gp 9.8 def % pesanteur
- /radius \psk at oscmetronomer 1e-2 mul def % en m
- /OA \psk at oscmetronomed 1e-2 mul def % distance de l'axe au centre du disque en m
- /xC \psk at oscmetronomex 1e-2 mul def % position du curseur en m par rapport \xE0 l'axe
- /theta0 \psk at oscmetronomethetai def % en degr\xE9s
- /theta0rad theta0 deg2rad def % en radians
- /Md \psk at oscmetronometM 1e-3 mul def % en kg
- /mc \psk at oscmetronometm 1e-3 mul def % en kg
- /dt \psk at oscmetronomedt def
- /nT \psk at oscmetronomenT def
- % moment d'inertie du m\xE9tronome
- % J=1/2M*R^2+M*a^2+m*x^2
- /Ji {0.5 Md mul radius dup mul mul Md OA dup mul mul add mc xC dup mul mul add} def
- /AT {4
-      Ji
-      gp Md OA mul mc xC mul sub mul
-      div
-      sqrt
-      mul} def
- % Pour le calcul de la p\xE9riode
- % coefficients de l'approximation polyn\xF4miale du calcul
- % de l'int\xE9grale elliptique
-% coefficient pour le calcul de l'int\xE9grale elliptique
-        /m0 theta0 2 div sin def
-        /m1 {1 m0 dup mul sub} def
-        /m2 {m1 dup mul} def
-        /m3 {m2 m1 mul} def
-        /m4 {m2 dup mul} def
-        /m_1 {1 m1 div} def
-     /EllipticK {
-        0.5
-        0.12498593597 m1 mul add
-        0.06880248576 m2 mul add
-        0.03328355376 m3 mul add
-        0.00441787012 m4 mul add
-        m_1 ln mul
-        1.38629436112 add
-        0.09666344259 m1 mul add
-        0.03590092383 m2 mul add
-        0.03742563713 m3 mul add
-        0.01451196212 m4 mul add
-      } def
-/Tm {AT EllipticK mul} def
-% tableau des valeurs de theta(t)
-    /W 0 def % vitesse angulaire
-    /theta theta0 def
-    /oscillateur {sin gp Md OA mul mc xC mul sub mul neg mul Ji div} def
-    /j1 {W dt mul} def
-    /k1 {theta oscillateur dt mul} def
-    /j2 {W k1 2 div add dt mul} def
-    /k2 {theta j1 2 div rad2deg add oscillateur dt mul} def
-    /j3 {W k2 2 div add dt mul} def
-    /k3 {theta j2 2 div rad2deg add oscillateur dt mul} def
-    /j4 {W k3 add dt mul} def
-    /k4 {theta j3 rad2deg add oscillateur dt mul} def
-    /theta2 {theta j1 rad2deg 2 j2 rad2deg j3 rad2deg add mul add j4 rad2deg add 6 div add} def
-/tabTheta [ % pour l'animation
-    0 theta0 % date angle
-dt dt Tm nT mul{ %
-    theta2 %
-    /W2 W k1 2 k2 k3 add mul add k4 add 6 div add def
-    /theta theta2 def
-    /W W2 def
-    }  for
-        ] def
-/Nvaleurs tabTheta length 2 div cvi def
-    /W 0 def % vitesse angulaire
-    /theta theta0 def
-/tabThetaGraph [ % pour le graphique theta(t)
-    0 theta0  % date angle
-0 dt Tm nT mul { % pop
-    theta2 % 180 div 3.14159 mul
-    /W2 W k1 2 k2 k3 add mul add k4 add 6 div add def
-    /theta theta2 def
-    /W W2 def
-    }  for
-        ] def
-    /W 0 def % vitesse angulaire
-    /theta theta0 def
-/tabThetaPoint [ % pour le graphique thetapoint(t)
-    0 0  % date angle
-dt dt Tm nT mul { % pop
-%    theta2 % 180 div 3.14159 mul
-    /W2 W k1 2 k2 k3 add mul add k4 add 6 div add def
-    W2
-    /theta theta2 def
-    /W W2 def
-    }  for
-        ] def
-/tabXOSC [ % oscillations par min en fonction de x
-0.5 0.1 12 {/xc exch def
- /xC xc 1e-2 mul def
- xc 60 Tm div % cvi
- } for
-        ] def
-/tabXbattements [ % battements par min en fonction de x
-3 0.1 12 {/xc exch def
- /xC xc 1e-2 mul def
- xc 60 Tm div 2 mul % cvi
- } for
-        ] def
-% graduation T --> x
-/tabXT [ % [T,x]
- 40 1 220 {/batt exch def % battements
- /Tmetronome2 120 batt div dup mul def
- /A1 16 mc mul EllipticK dup mul mul def
- /B1 gp Tmetronome2 mul mc mul def
- /C1 gp Md mul OA mul Tmetronome2 mul neg
-     8 Md mul radius dup mul mul 16 Md mul OA dup mul mul add EllipticK dup mul mul add def
- /Delta B1 dup mul 4 A1 mul C1 mul sub sqrt def
- /xC1 B1 neg Delta sub 2 div A1 div def
- /xC2 B1 neg Delta add 2 div A1 div def
- xC2 0 ge {/posC xC2 def}{/posC xC1 def} ifelse
- batt posC 1e2 mul
- } for
-        ] def
-/xT { % pour une valeur particuli\xE8re battement -> position du curseur
-    /batt exch def
-    /Tmetronome2 120 batt div dup mul def
-    /A1 16 mc mul EllipticK dup mul mul def
-    /B1 gp Tmetronome2 mul mc mul def
-    /C1 gp Md mul OA mul Tmetronome2 mul neg
-     8 Md mul radius dup mul mul 16 Md mul OA dup mul mul add EllipticK dup mul mul add def
-    /Delta B1 dup mul 4 A1 mul C1 mul sub sqrt def
-    /xC1 B1 neg Delta sub 2 div A1 div def
-    /xC2 B1 neg Delta add 2 div A1 div def
-     xC2 0 ge {/posC xC2 def}{/posC xC1 def} ifelse
-     posC 1e2 mul
- } def
-/xC \psk at oscmetronomex 1e-2 mul def % position du curseur en m par rapport \xE0 l'axe
-/Tm {AT EllipticK mul} def
-  }%
-  \end at SpecialObj%
-\endgroup}
-%
-\def\psmetronomeA{\pst at object{psmetronomeA}}
-\def\psmetronomeA at i{%
-\begingroup%
-\use at par%
-  \begin at SpecialObj%
-  \pstVerb{%
- /radius \psk at oscmetronomer 1e-2 mul def % en m
- /OA \psk at oscmetronomed 1e-2 mul def % distance de l'axe au centre du disque en m
- /xC \psk at oscmetronomex 1e-2 mul def % position du curseur en m par rapport \xE0 l'axe
-  }%
-\psframe[fillstyle=solid](! -0.075 \psk at oscmetronomed neg)(0.075,13)
-\pscircle[fillstyle=solid,fillcolor={[rgb]{0.75 0.75 0.75}}](! 0 \psk at oscmetronomed neg){!radius 1e2 mul}
-\pscircle[fillstyle=solid,linewidth=0.05](0,0){0.15}
-\pscircle*[linecolor=red](0,0){0.05}
-% curseur
-\pspolygon[fillstyle=solid](! -0.25 \psk at oscmetronomex 0.5 sub)(! -0.5 \psk at oscmetronomex 0.5 add)(!-0.075 \psk at oscmetronomex 0.5 add)(!-0.075 \psk at oscmetronomex 0.5 sub)
-\pspolygon[fillstyle=solid](! 0.25 \psk at oscmetronomex 0.5 sub)(! 0.5 \psk at oscmetronomex 0.5 add)(!0.075 \psk at oscmetronomex 0.5 add)(!0.075 \psk at oscmetronomex 0.5 sub)
-\pspolygon[fillstyle=solid,fillcolor=gray](! -0.25 \psk at oscmetronomex 0.5 sub)(! -0.3 \psk at oscmetronomex 0.3 sub)(! -0.075 \psk at oscmetronomex 0.3 sub)(!-0.075 \psk at oscmetronomex 0.3 add)(!0.075 \psk at oscmetronomex 0.3 add)(!0.075 \psk at oscmetronomex 0.3 sub)(!0.3 \psk at oscmetronomex 0.3 sub)(!0.25 \psk at oscmetronomex 0.5 sub)
-\pscircle[fillstyle=solid](!-0.125 \psk at oscmetronomex 0.4 sub){0.08}
-\pscircle[fillstyle=solid](!0.125 \psk at oscmetronomex 0.4 sub){0.08}
-% fin curseur
-{\psset{linecolor=red}
-\psline(!-.1 \psk at oscmetronomex)(!0.1 \psk at oscmetronomex)\psline(!0 \psk at oscmetronomex 0.1 sub)(!0 \psk at oscmetronomex 0.1 add)
-\psline(! -.1 \psk at oscmetronomed neg)(!0.1 \psk at oscmetronomed neg)\psline(! 0 \psk at oscmetronomed neg 0.1 sub)(!0 \psk at oscmetronomed neg 0.1 add)}
-\pnode(!0 \psk at oscmetronomex){C}% curseur
-\pnode(! 0 \psk at oscmetronomed neg){D}% disque
-\pstextpath[c](0,-2ex){\psarcn[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{m e t r o n o m e}}}
-\pstextpath[c](0,1ex){\psarc[linestyle=none](D){1}{180}{0}}{\small\textsf{\textbf{P S t r i c k s}}}
-  \end at SpecialObj%
-\endgroup}
-\psmetronome%
-\pstVerb{/tabTempos [40 42 44 46 48 50 52 54 46 58 60 63 66 69 72 76 80 84 88 92 96 100 104 108 112 116 120 126 132 138 144 152 160 168 176 184 192 200 208] def}%
-
-\def\metronomebody{%
-  \pspolygon[fillstyle=solid,linewidth=2\pslinewidth,linearc=0.5,fillcolor=yellow!30](-5,-4.5)(5,-4.5)(1,14)(-1,14)
-  \psline(1.2,4.5)(1.2,12.5)
-  \psline(-1.2,4.5)(-1.2,12.5)
-  \multido{\i=0+2}{20}{%
-     \pstVerb{/BATT tabTempos \i\space get def}
-     \psline[linecolor=red](!1.2 BATT xT)(!0.7 BATT xT)
-     \uput[r](!0.7 BATT xT){\psPrintValue[PSfont=Helvetica,fontscale=6]{BATT}}
-  }%
-  \multido{\i=1+2}{19}{%
-     \pstVerb{/BATT tabTempos \i\space get def}
-     \psline[linecolor=red](!-1.2 BATT xT)(!-0.7 BATT xT)
-     \uput[r](!-1.3 BATT xT){\psPrintValue[PSfont=Helvetica,fontscale=6]{BATT}}}%
-  \rput(!0 40 xT){\textsf{\tiny GRAVE}}%
-  \rput(!0 46 xT){\textsf{\tiny LARGO}}%
-  \rput(!0 52 xT){\textsf{\tiny LENTO}}%
-  \rput(!0 58 xT){\textsf{\tiny ADAGIO}}%
-  \rput(!0 60 xT){\textsf{\tiny LARGETTO}}%
-  \rput(!0 66 xT){\textsf{\tiny ANDANTE}}%
-  \rput(!0 76 xT){\textsf{\tiny ANDANTINO}}%
-  \rput(!0 84 xT){\textsf{\tiny MODERATO}}%
-  \rput(!0 108 xT){\textsf{\tiny ALLEGRETTO}}%
-  \rput(!0 132 xT){\textsf{\tiny ALLEGRO}}%
-  \rput(!0 160 xT){\textsf{\tiny VIVACE}}%
-  \rput(!0 184 xT){\textsf{\tiny PRESTO}}%
-  \rput(!0 200 xT){\textsf{\tiny PRESTISSIMO}}%
-}
-
-\def\pendulum#1{%
-  \pstVerb{/iA #1\space def /date tabTheta iA get def /Theta tabTheta iA 1 add get def}%
-  \rput{!Theta}{\psmetronomeA}%
-}
-\makeatother

Modified: trunk/Master/texmf-dist/source/latex/animate/files/scarab.mp
===================================================================
--- trunk/Master/texmf-dist/source/latex/animate/files/scarab.mp	2018-11-29 23:14:58 UTC (rev 49272)
+++ trunk/Master/texmf-dist/source/latex/animate/files/scarab.mp	2018-11-29 23:19:26 UTC (rev 49273)
@@ -1,7 +1,9 @@
 % Maxime Chupin, Alexander Grahn
-% 2017/02/27
+% 2018/11/29
 
-filenametemplate "%j_%c.mps";
+prologues:=3;
+outputtemplate := "%j_%c.mps";
+outputformat := "mps";
 
 verbatimtex
 \documentclass{article}

Modified: trunk/Master/texmf-dist/tex/latex/animate/animate.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2018-11-29 23:14:58 UTC (rev 49272)
+++ trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2018-11-29 23:19:26 UTC (rev 49273)
@@ -13,7 +13,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 
-\def\@anim at version{2018/11/20}
+\def\@anim at version{2018/11/29}
 \ProvidesPackage{animate}
 [\@anim at version\space PDF & SVG animations from files and inline graphics]
 
@@ -1334,6 +1334,8 @@
           \IfFileExists{#1\@anim at ext}{}{%
           \gdef\@anim at ext{.ps}%
           \IfFileExists{#1\@anim at ext}{}{%
+          \gdef\@anim at ext{.mps}%
+          \IfFileExists{#1\@anim at ext}{}{%
           \gdef\@anim at ext{.svg}%
           \IfFileExists{#1\@anim at ext}{}{%
           \gdef\@anim at ext{.png}%
@@ -1346,6 +1348,7 @@
               None of the files\MessageBreak%
               `#1.eps',\MessageBreak%
               `#1.ps',\MessageBreak%
+              `#1.mps',\MessageBreak%
               `#1.svg',\MessageBreak%
               `#1.png',\MessageBreak%
               `#1.jpg',\MessageBreak%
@@ -1353,7 +1356,7 @@
               could be found.\MessageBreak%
               Wrong file type? Mis-spelled file name?%
             }{}%
-          }}}}}}%
+          }}}}}}}%
         \else%
           \gdef\@anim at ext{.#2}%
           \IfFileExists{#1\@anim at ext}{}{%
@@ -1877,10 +1880,6 @@
       id='anm#1'
       \if at anim@nomouse\else
         cursor='pointer'
-        onmousedown='onMouseDownWdgt();'
-        % not working in FF while doing so in Chrome; FF fails to pass
-        % MouseEvent to handler; bug? will use addEventListener()
-        %onmouseup='onMouseUpWdgt(event);'
       \fi%
     }%
     \@anim at updatebbox{\@anim at animwidth}{\@anim at animheight}{\@anim at animdepth}%
@@ -1958,8 +1957,8 @@
         /PI <</S/JavaScript/JS \@anim at pcjscriptobj>>% PageInvisible
         /PC <</S/JavaScript/JS \@anim at pcjscriptobj>>% PageClose
         \if at anim@nomouse\else%
-          /D <</S/JavaScript/JS (\@anim at wdgtDownJSString{#1})>>% mouse-down
-          /U <</S/JavaScript/JS (\@anim at wdgtUpJSString{#1})>>% mouse-up
+          /D <</S/JavaScript/JS (\@anim at wdgtDownJS{#1})>>% mouse-down
+          /U <</S/JavaScript/JS (\@anim at wdgtUpJS{#1})>>% mouse-up
         \fi%
       >>%
       /AP <</N \@anim at apmk>>%
@@ -2009,7 +2008,7 @@
     % insert widget
     \if at anim@js%
       \@anim at annot{\@anim at btnsize}{\@anim at btnsize}{\z@}{%
-        cursor='pointer' onmouseup='\@anim at btnUpJSString{#1}{\@anim at arg}'%
+        cursor='pointer' onmousedown='\@anim at btnJS{#1}{\@anim at arg}'%
       }%
       \@anim at updatebbox{\@anim at btnsize}{\@anim at btnsize}{}%
       \hbox to \@anim at btnsize {%
@@ -2020,7 +2019,7 @@
   }
 \else
   \def\@anim at buttonwidget#1#2#3{%#1:@anim at num, #2:action,
-                                %  #3:button face and colour combination
+                                %#3:button face and colour combination
     \edef\@anim at arg{#2}\@anim at jstrue\@anim at mktrue%
     \def\@anim at annotflag{/F 0}% visible, but don't print
     \ifx\@anim at PlayLeft\@anim at arg\@anim at jsfalse\fi%       %hidden, don't print |
@@ -2052,7 +2051,8 @@
       /T (#1.#2)%
       \@anim at tooltip%
       \if at anim@js%
-        /A <</S/JavaScript/JS (\@anim at btnUpJSString{#1}{\@anim at arg})>>%
+        %/A <</S/JavaScript/JS (\@anim at btnJS{#1}{\@anim at arg})>>%
+        /AA <</D <</S/JavaScript/JS (\@anim at btnJS{#1}{\@anim at arg})>>>>%
       \fi%
     }%
     \if at anim@js%
@@ -4047,7 +4047,7 @@
 }
 
 %other trigger events in the anim widget's AA dictionary
-\gdef\@anim at wdgtDownJSString#1{%
+\gdef\@anim at wdgtDownJS#1{%
   \if at anim@dvisvgm\else
     app.focusRect=false;$% disable focus rectangle
   \fi%
@@ -4055,7 +4055,7 @@
     try{if(a#1_playing){a#1_pause();}}catch(e){}$%
   \fi%
 }%
-\gdef\@anim at wdgtUpJSString#1{%
+\gdef\@anim at wdgtUpJS#1{%
   try{$%
     \if at anim@step%
       \if at anim@palindrome
@@ -4120,7 +4120,7 @@
 \gdef\@anim at Plus{Plus}%
 
 %actions for control buttons
-\gdef\@anim at btnUpJSString#1#2{%
+\gdef\@anim at btnJS#1#2{%
   \if at anim@dvisvgm\else
     app.focusRect=false;%
   \fi%
@@ -4165,6 +4165,14 @@
           \if at anim@nomouse\else
             document.getElementById('anm#1').addEventListener('mouseup',%
               onMouseUpWdgt);$%
+            document.getElementById('anm#1').addEventListener('mousedown',%
+              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
         }$%
@@ -4184,11 +4192,38 @@
 	      document.addEventListener('visibilitychange',onVisibilityChange);$%
 	      window.addEventListener('load',onload);$%
         \if at anim@nomouse\else
-          function onMouseDownWdgt(){$%
-            \@anim at wdgtDownJSString{#1}%
+          var permPause#1=false;
+          function onWidgetUpAction(event){$%
+            \@anim at wdgtUpJS{#1}%
           }$%
+          function onTouchStartWdgt(event){$%
+            event.preventDefault();$%
+            event.stopPropagation();$%
+            permPause#1=false;
+            \@anim at 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();$%
+          }$%
+          function onMouseDownWdgt(event){$%
+            event.preventDefault();$%
+            event.stopPropagation();$%
+            \@anim at wdgtDownJS{#1}%
+          }$%
           function onMouseUpWdgt(event){$%
-            \@anim at wdgtUpJSString{#1}%
+            event.preventDefault();$%
+            event.stopPropagation();$%
+            onWidgetUpAction(event);$%
           }$%
         \fi%
       ]]>$%



More information about the tex-live-commits mailing list