texlive[42009] Master/texmf-dist: animate (7sep16)

commits+karl at tug.org commits+karl at tug.org
Wed Sep 7 23:47:38 CEST 2016


Revision: 42009
          http://tug.org/svn/texlive?view=revision&revision=42009
Author:   karl
Date:     2016-09-07 23:47:38 +0200 (Wed, 07 Sep 2016)
Log Message:
-----------
animate (7sep16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/animate/ChangeLog
    trunk/Master/texmf-dist/doc/latex/animate/README
    trunk/Master/texmf-dist/doc/latex/animate/animate.pdf
    trunk/Master/texmf-dist/source/latex/animate/animate.tex
    trunk/Master/texmf-dist/tex/latex/animate/animate.sty

Modified: trunk/Master/texmf-dist/doc/latex/animate/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/doc/latex/animate/ChangeLog	2016-09-07 21:47:27 UTC (rev 42008)
+++ trunk/Master/texmf-dist/doc/latex/animate/ChangeLog	2016-09-07 21:47:38 UTC (rev 42009)
@@ -1,3 +1,6 @@
+2016-09-07
+	* fix: adjust JavaScript part for compatibility with Foxit Reader
+
 2016-08-31
 	* fix: missing variable declarations in JavaScript part
 

Modified: trunk/Master/texmf-dist/doc/latex/animate/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/animate/README	2016-09-07 21:47:27 UTC (rev 42008)
+++ trunk/Master/texmf-dist/doc/latex/animate/README	2016-09-07 21:47:38 UTC (rev 42009)
@@ -15,7 +15,7 @@
     generated pictures, or just from typeset text.
 
     It supports the usual PDF making workflows, i. e.  pdfLaTeX, LaTeX -> dvips
-    -> ps2pdf (Ghostscript)/Distiller and (Xe)LaTeX -> (x)dvipdfmx.
+    -> ps2pdf (Ghostscript)/Distiller and (Xe)LaTeX -> (x)dvipdfmx, LuaLaTeX.
 
     The resulting PDF with animations can be viewed in Acrobat Reader (except on
     mobile devices), in PDF-XChange and in Foxit Reader.
@@ -27,7 +27,8 @@
     Keywords: include portable PDF animated PDF animation animating
     embed animated graphics LaTeX pdfLaTeX PSTricks pgf TikZ MetaPost
     LaTeX-picture inline graphics vector graphics animated GIF LaTeX
-    dvips ps2pdf dvipdfmx XeLaTeX JavaScript Acrobat Reader
+    dvips ps2pdf dvipdfmx XeLaTeX JavaScript Acrobat Reader PDF-XChange
+	Foxit Reader
 
 
 Usage:

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	2016-09-07 21:47:27 UTC (rev 42008)
+++ trunk/Master/texmf-dist/source/latex/animate/animate.tex	2016-09-07 21:47:38 UTC (rev 42009)
@@ -1,5 +1,6 @@
+\ifdefined\outputmode\outputmode=0\fi
+\ifdefined\pdfoutput\pdfoutput=0\fi
 \tracingstats1
-\pdfoutput=0
 % Copyright 2007--\today Alexander Grahn
 %
 % This material is subject to the LaTeX Project Public License. See
@@ -23,8 +24,9 @@
 \usepackage{lmodern}
 \usepackage{mflogo}
 \usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
 \usepackage[protrusion]{microtype}
-\usepackage{ifpdf}
+%\usepackage{ifpdf}
 \usepackage{parskip}
 \usepackage{tabls}
 \usepackage{multirow}
@@ -49,11 +51,11 @@
                                      {\itshape\normalsize}}
 \makeatother
 
-\ifpdf
-  \makeatletter
-  \@latex at error{This document contains PSTricks code.\MessageBreak Please compile it using the following commands:\MessageBreak\MessageBreak latex, dvips, ps2pdf\MessageBreak\MessageBreak Don't use option `-Ppdf` with dvips}
-  \makeatother
-\fi
+%\ifpdf
+%  \makeatletter
+%  \@latex at error{This document contains PSTricks code.\MessageBreak Please compile it using the following commands:\MessageBreak\MessageBreak latex, dvips, ps2pdf\MessageBreak\MessageBreak Don't use option `-Ppdf` with dvips}
+%  \makeatother
+%\fi
 
 \def\keywords{include portable PDF animation animated PDF animating embed animated graphics LaTeX pdfLaTeX LuaLaTeX PSTricks pgf TikZ LaTeX-picture MetaPost inline graphics vector graphics animated GIF LaTeX dvips ps2pdf dvipdfmx XeLaTeX JavaScript Acrobat Reader PDF-XChange Foxit Reader}
 \hypersetup{
@@ -272,7 +274,7 @@
 Step through the animation one frame at a time per mouse-click. The \verb+<frame rate>+ argument will be ignored.
 \begin{verbatim}
 width=<h-size>
-height=<v-size> | totalheight=<v-size>,
+height=<v-size> | totalheight=<v-size>
 keepaspectratio
 \end{verbatim}
 Resize the animation widget. If only one of `\verb+width+' or `\verb+[total]height+' is given, the other dimension of the animation widget is scaled to maintain the aspect ratio of the first frame's content. If both `\verb+width+' and `\verb+[total]height+' are given together with `\verb+keepaspectratio+', the first frame's content is resized to fit within \verb+<h-size>+ and \verb+<v-size>+ while maintaining its original aspect ratio. Any valid \TeX{} dimension is accepted as a parameter. In addition, the length commands \verb+\width+, \verb+\height+, \verb+\depth+ and \verb+\totalheight+ can be used to refer to the original dimensions of the first frame of the animated sequence.
@@ -525,7 +527,7 @@
 \subsection[Animations from sets of files, using `animategraphics' command]{Animations from sets of files, using {\tt \string\animategraphics} command}\label{sect:examples}
 Animations in this section are made from graphics files that were prepared with \MP. Run `\verb+mpost --tex=latex+' on the files ending in `.mp' in the `files' directory to generate the graphics files. Both examples make use of the `\verb+timeline+' option to reduce the resulting PDF file size.
 
-The first example, Fig.~\ref{fig:taylor}, originally written by Jan Hole\v{c}ek~\cite{hol}, shows the exponential function $y=e^x$ and its approximation by Taylor polynomials of different degree. Below the animation, a custom button was inserted using the JavaScript programming interface and the \verb+\mediabutton+ command from the `media9' package.
+The first example, Fig.~\ref{fig:taylor}, originally written by Jan Holeček~\cite{hol}, shows the exponential function $y=e^x$ and its approximation by Taylor polynomials of different degree. Below the animation, a custom button was inserted using the JavaScript programming interface and the \verb+\mediabutton+ command from the `media9' package.
 
 \small
 \begin{verbatim}
@@ -914,13 +916,13 @@
 \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
+\psset[pst-metronome]{x=8.4} % position du curseur en cm par rapport à 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
+\psset[pst-metronome]{nT=1} % nombre de périodes représentées
 %---- calculer theta(t) et thetapoint(t) --------
 \def\psmetronome{\pst at object{psmetronome}}
 \def\psmetronome at i{%
@@ -933,14 +935,14 @@
  /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
+ /xC \psk at oscmetronomex 1e-2 mul def % position du curseur en m par rapport à l'axe
+ /theta0 \psk at oscmetronomethetai def % en degrés
  /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
+ % moment d'inertie du métronome
  % 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
@@ -949,10 +951,10 @@
       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
+ % Pour le calcul de la période
+ % coefficients de l'approximation polynômiale du calcul
+ % de l'intégrale elliptique
+% coefficient pour le calcul de l'intégrale elliptique
         /m0 theta0 2 div sin def
         /m1 {1 m0 dup mul sub} def
         /m2 {m1 dup mul} def
@@ -1046,7 +1048,7 @@
  batt posC 1e2 mul
  } for
         ] def
-/xT { % pour une valeur particuli\xE8re battement -> position du curseur
+/xT { % pour une valeur particulière battement -> position du curseur
     /batt exch def
     /Tmetronome2 120 batt div dup mul def
     /A1 16 mc mul EllipticK dup mul mul def
@@ -1059,7 +1061,7 @@
      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
+/xC \psk at oscmetronomex 1e-2 mul def % position du curseur en m par rapport à l'axe
 /Tm {AT EllipticK mul} def
   }%
   \end at SpecialObj%
@@ -1073,7 +1075,7 @@
   \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
+ /xC \psk at oscmetronomex 1e-2 mul def % position du curseur en m par rapport à 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}
@@ -1320,12 +1322,12 @@
 \end{itemize}
 
 \section{Acknowledgements}
-I would like to thank Fran\c{c}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.
+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.
 
 \begin{thebibliography}{8}
 \bibitem{chupin} Chupin, M.: \emph{Syracuse MetaPost/Animations.} URL: \url{http://melusine.eu.org/syracuse/metapost/animations/chupin/?idsec=scara}
 \bibitem{gilg05} Gilg, J.: PDF-Animationen. In: \emph{Die \TeX nische Kom\"odie}, Issue 4, 2005, pp.~30--37
-\bibitem{hol} Hole\v{c}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.: \emph{Animations in a pdf\TeX-generated PDF}. URL: \url{http://www.fi.muni.cz/~xholecek/tex/pdfanim.xhtml}
 \bibitem{luque12} Luque, M.: \emph{PSTricks : applications.} URL: \url{http://pstricks.blogspot.com}
 \bibitem{media9} \emph{The media9 Package}. URL: \url{http://www.ctan.org/pkg/media9}
 \end{thebibliography}

Modified: trunk/Master/texmf-dist/tex/latex/animate/animate.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2016-09-07 21:47:27 UTC (rev 42008)
+++ trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2016-09-07 21:47:38 UTC (rev 42009)
@@ -13,7 +13,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 
-\def\@anim at version{2016/08/31}
+\def\@anim at version{2016/09/07}
 \ProvidesPackage{animate}
 [\@anim at version\space PDF animations from files and inline graphics]
 
@@ -2236,7 +2236,7 @@
   \ifx\@anim at tmp\@empty\else%
     \xdef\@anim at usrjsat{%
       \@anim at usrjsat%
-      a\the\@anim at num_usrJSat[\the\@anim at curframe@zb]=function(){#1};%
+      var a\the\@anim at num_usrJSat_\the\@anim at curframe@zb=function(){#1};%
     }%
     \setboolean{@anim at usrjs}{true}%
   \fi%
@@ -2935,9 +2935,9 @@
 \def\@anim@@pojscript#1{% #1: @anim at num
 %  console.show();%
 %  console.clear();%
-  var curdoc=this,a#1_idx\if at anim@step\else,a#1_int\fi;%
-  if(typeof a#1==='undefined'){% initialize animation
-    var a#1={};%
+  if(typeof a#1_idx==='undefined'){% initialize animation
+    var a#1_idx\ifnum\@anim at method>\z@,a#1_on=0\fi%
+      \if at anim@step\else,a#1_int\fi;%
     %takes references to frame ocgs/Field objects belonging to the current
     %animation
     var a#1_fr=new Array();%
@@ -3005,7 +3005,6 @@
     \fi%
     \if at anim@usrjs
       %array to take frame numbers (array index) and user provided JavaScript
-      var a#1_usrJSat=new Array();%
       \@anim at usrjsat%
     \fi%
     %actions
@@ -3014,11 +3013,11 @@
         if(f<-1){%
           \ifcase\@anim at method %icon based
             a#1_wid.buttonSetIcon(blnk);%
-            curdoc.dirty=false;%
+            this.dirty=false;%
           \or %widget based
             a#1_on=0;%
             a#1_fr[0].display=display.hidden;%
-            curdoc.dirty=false;%
+            this.dirty=false;%
           \or %ocg based
             a#1_on=0;%
             a#1_fr[0].state=false;%
@@ -3029,19 +3028,20 @@
       if(f>\@anim at maxframe||f<0){return -1;}%
       a#1_idx=f;%
       \if at anim@usrjs
-        if(a#1_usrJSat[f]){%
-          cmd='try{a#1_usrJSat['+f+']();}catch(e){console.println(e);}';%
-          ret=app.setTimeOut(cmd,1);%
+        if(typeof this['a#1_usrJSat_'+f]!=='undefined'){%
+          ret=app.setTimeOut(% execute JS in "parallel"
+            'try{a#1_usrJSat_'+f+'();}catch(e){console.println(e);}',1%
+          );%
         }%
       \fi%
       \ifcase\@anim at method %icon based
         a#1_wid.buttonSetIcon(a#1_fr[f]);%
-        curdoc.dirty=false;%
+        this.dirty=false;%
       \or %widget based
         a#1_fr[a#1_on].display=display.hidden;%
         a#1_fr[f].display=display.visible;%
         a#1_on=f;%
-        curdoc.dirty=false;%
+        this.dirty=false;%
       \or %ocg based
         a#1_fr[a#1_on].state=false;%
         a#1_fr[f].state=true;%
@@ -3152,7 +3152,7 @@
           a#1_btnPlayLeft.display=display.visible;%
           a#1_btnPauseRight.display=display.hidden;%
           a#1_btnPlayRight.display=display.visible;%
-          curdoc.dirty=false;%
+          this.dirty=false;%
         \fi%
       };%
       var a#1_playRight=function(){%
@@ -3169,7 +3169,7 @@
           a#1_btnPlayLeft.display=display.hidden;%
           a#1_btnPauseRight.display=display.visible;%
           a#1_btnPlayRight.display=display.hidden;%
-          curdoc.dirty=false;%
+          this.dirty=false;%
         \fi%
       };%
       var a#1_playLeft=function(){%
@@ -3186,7 +3186,7 @@
           a#1_btnPlayLeft.display=display.hidden;%
           a#1_btnPauseRight.display=display.visible;%
           a#1_btnPlayRight.display=display.hidden;%
-          curdoc.dirty=false;%
+          this.dirty=false;%
         \fi%
       };%
       \if at anim@controls
@@ -3288,16 +3288,13 @@
         };%
       }%
     \fi%
-    \ifnum\@anim at method>\z@ var a#1_on=0;\fi%initialize a#1_on here!!!
-    \ifnum\@anim at poster=\@anim at mtwo %poster=none
-      ret=app.setTimeOut('a#1_seekFrame(-2)',1);%
-    \fi%
-    \ifnum\@anim at poster>\@anim at mone %poster=<num>|first
-      ret=app.setTimeOut('a#1_seekFrame(\@anim at poster)',1);%
-    \fi%
-    \ifnum\@anim at poster=\@anim at mone %poster=last
-      ret=app.setTimeOut('a#1_seekFrame(\@anim at maxframe)',1);%
-    \fi%
+%    \ifnum\@anim at method>\z@ var a#1_on=0;\fi%
+    %poster=none
+    \ifnum\@anim at poster=\@anim at mtwo a#1_seekFrame(-2);\fi%
+    %poster=<num>|first
+    \ifnum\@anim at poster>\@anim at mone a#1_seekFrame(\@anim at poster);\fi%
+    %poster=last
+    \ifnum\@anim at poster=\@anim at mone a#1_seekFrame(\@anim at maxframe);\fi%
   }%
   \if at anim@step\else%
     \if at anim@autoplayorresume%
@@ -3332,15 +3329,12 @@
   \fi
   %re-display poster frame
   if(!a#1_isPaused){% i.e. if stopped
-    \ifnum\@anim at poster=\@anim at mtwo %poster=none
-      ret=app.setTimeOut('a#1_seekFrame(-2)',1);%
-    \fi%
-    \ifnum\@anim at poster>\@anim at mone %poster=<num>|first
-      ret=app.setTimeOut('a#1_seekFrame(\@anim at poster)',1);%
-    \fi%
-    \ifnum\@anim at poster=\@anim at mone %poster=last
-      ret=app.setTimeOut('a#1_seekFrame(\@anim at maxframe)',1);%
-    \fi%
+    %poster=none
+    \ifnum\@anim at poster=\@anim at mtwo a#1_seekFrame(-2);\fi%
+    %poster=<num>|first
+    \ifnum\@anim at poster>\@anim at mone a#1_seekFrame(\@anim at poster);\fi%
+    %poster=last
+    \ifnum\@anim at poster=\@anim at mone a#1_seekFrame(\@anim at maxframe);\fi%
   }%
 }
 



More information about the tex-live-commits mailing list