From 7674fdfd8ff8e191c3ca661562a72f8f15049e00 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 29 Nov 2007 14:20:55 +0000 Subject: animate update from ctan git-svn-id: svn://tug.org/texlive/trunk@5645 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/animate/README | 6 +- .../texmf-dist/doc/latex/animate/doc/animate.pdf | Bin 1308016 -> 1311209 bytes .../texmf-dist/doc/latex/animate/doc/animate.tex | 17 ++++- .../doc/latex/animate/doc/files/scarab.mp | 2 +- Master/texmf-dist/tex/latex/animate/animate.sty | 83 +++++++++++---------- 5 files changed, 64 insertions(+), 44 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/animate/README b/Master/texmf-dist/doc/latex/animate/README index 1af31cea478..22363a9b714 100644 --- a/Master/texmf-dist/doc/latex/animate/README +++ b/Master/texmf-dist/doc/latex/animate/README @@ -72,14 +72,16 @@ Usage: buttonfg=, loop, palindrome, step, poster[=first | none | last], begin={}, end={}, timeline=, - every= + every=, bb= , + viewport= , + trim= Requirements: pdfTeX, version >= 1.20 Ghostscript, version >= 8.31 or Adobe Distiller - Adobe Reader, version >= 6 + Adobe Reader, version >= 6, but not 8.0 and 8.1 Installation: diff --git a/Master/texmf-dist/doc/latex/animate/doc/animate.pdf b/Master/texmf-dist/doc/latex/animate/doc/animate.pdf index ad0fe39cea0..3f0ebce6ee6 100644 Binary files a/Master/texmf-dist/doc/latex/animate/doc/animate.pdf and b/Master/texmf-dist/doc/latex/animate/doc/animate.pdf differ diff --git a/Master/texmf-dist/doc/latex/animate/doc/animate.tex b/Master/texmf-dist/doc/latex/animate/doc/animate.tex index 794d4a5faa7..6015c3ae370 100644 --- a/Master/texmf-dist/doc/latex/animate/doc/animate.tex +++ b/Master/texmf-dist/doc/latex/animate/doc/animate.tex @@ -182,6 +182,18 @@ scale= \end{verbatim} Scales the animation widget by \verb++. \begin{verbatim} +bb= +\end{verbatim} +(\verb+\animategraphics+ only, requires package `graphicx'.) The four, space separated arguments set the bounding box of the graphics files. Units can be omitted, in which case `bp' (Postscript points) are assumed. +\begin{verbatim} +viewport= +\end{verbatim} +(\verb+\animategraphics+ only, requires package `graphicx'.) This option takes four arguments, just like bb. However, in this case the values are taken relative to the origin specified by the bounding box in the graphics files. +\begin{verbatim} +trim= +\end{verbatim} +(\verb+\animategraphics+ only, requires package `graphicx'.) Crops the 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. +\begin{verbatim} controls \end{verbatim} Inserts control buttons below the animation widget. The meaning of the buttons is as follows, from left to right: stop \& first frame, step backward, play backward, play forward, step forward, stop \& last frame, decrease speed, default speed, increase speed. Both `play' buttons are replaced by a large `pause' button while the animation is playing. @@ -251,7 +263,7 @@ In the first example, transparency No. 0 appears in the foreground throughout th \emph{Grouping objects into layers using `{\tt;}'} -This stack-like concept of animations, where transparencies are always put on top such that they overprint the content of previously deposited transparencies, can be inconvenient in certain situations. For example, it might be desirable to allow for changing the background image in the middle of an animation without affecting objects that are located in the foreground. For this purpose, transparency specifications can be grouped into \emph{layers} using the semicolon (\verb+;+) as a separator instead of the comma. This is best illustrated by an example: +The stack-like concept of animations, where transparencies are always put on top such that they overprint the content of previously deposited transparencies, can be inconvenient in certain situations. For example, it might be desirable to allow for changing the background image in the middle of an animation without affecting objects that are located in the foreground. For this purpose, transparency specifications can be grouped into \emph{layers} using the semicolon (\verb+;+) as a separator instead of the comma. This is best illustrated by an example: \begin{verbatim} ::0x49;2x0,3x0 :: ;4x0,5x0 @@ -263,10 +275,11 @@ This stack-like concept of animations, where transparencies are always put on to :: ;104x0,105x0 ... \end{verbatim} -In this timeline, the transparencies are grouped into two layers. One is reserved for the background images, transparencies No. 0 \& 1, that shall be exchanged after 49 frames, and another one for the foreground objects that are successively added to the scene. As can be seen in this example, layers need not be explicitly populated. The leading semicolons just ensure the proper relationship between transparencies and animation layers. Without setting up two layers, the foreground objects on transparencies 2 through 99 that have been added during the first 49 frames would be overprinted by the new background image, transparency 1, from frame 50 onwards. +In this timeline, the transparencies are grouped into two layers. One is reserved for the background images, transparencies No. 0 \& 1, that shall be exchanged after 49 frames, and another one for the foreground objects that are successively added to the scene. As can be seen in this example, layers need not be explicitly populated; the leading semicolons just ensure the proper relationship between transparencies and animation layers. Note that without setting up two layers, the foreground objects on transparencies 2 through 99 that have been added during the first 49 frames would be overprinted by the new background image, transparency 1, from frame 50 onward. See the second animation in Section~\ref{sect:examples} for a working example that makes use of the timeline and the layer concept. +\newpage \section{Examples} \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+' on the files ending in `.mp' in the `doc/files' directory to generate the graphics files. Both examples make use of the `\verb+timeline+' option to reduce the resulting PDF file size. diff --git a/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp b/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp index 0d4dcb69039..c12e563c30b 100644 --- a/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp +++ b/Master/texmf-dist/doc/latex/animate/doc/files/scarab.mp @@ -1,5 +1,5 @@ %@AUTHOR: Maxime Chupin, Alexander Grahn -%@DATE: 2007/10/02 +%@DATE: 2007/11/26 filenametemplate "%j_%c.mps"; diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty index 209611cebf2..be7c5b2b223 100644 --- a/Master/texmf-dist/tex/latex/animate/animate.sty +++ b/Master/texmf-dist/tex/latex/animate/animate.sty @@ -13,7 +13,7 @@ % Supports LaTeX->dvips->ps2pdf or pdfLaTeX workflows. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{animate}[2007/11/23] +\ProvidesPackage{animate}[2007/11/28] \RequirePackage{keyval} \RequirePackage{ifthen} \RequirePackage{ifpdf} @@ -92,6 +92,14 @@ }% } +\newboolean{@anim@grxloaded} +\setboolean{@anim@grxloaded}{false} +\AtBeginDocument{% + \@ifpackageloaded{graphicx}{% + \setboolean{@anim@grxloaded}{true}% + }{}% +} + %add OCProperties dict to Catalog \ifpdf \newcount\@anim@@ocgs @@ -150,17 +158,26 @@ \ifpdf %helper macro that typesets graphics file into savebox \def\@anim@filebox#1{% #1 filename - \def\@anim@mps{.mps}% - \ifx\@anim@ext\@anim@mps% - \global\setbox\@anim@box=\hbox{\convertMPtoPDF{#1}{1}{1}}% + \ifx\@anim@gropts\@empty% + \def\@anim@mps{.mps}% + \ifx\@anim@ext\@anim@mps% + \global\setbox\@anim@box=\hbox{\convertMPtoPDF{#1}{1}{1}}% + \else% + \pdfximage{#1}% + \global\setbox\@anim@box=\hbox{\pdfrefximage\pdflastximage}% + \fi% \else% - \pdfximage{#1}% - \global\setbox\@anim@box=\hbox{\pdfrefximage\pdflastximage}% + \edef\@anim@curfile{*[\@anim@gropts]{#1}}% + \global\setbox\@anim@box=\hbox{\expandafter\includegraphics\@anim@curfile}% \fi% } \else \def\@anim@filebox#1{% #1 filename - \edef\@anim@curfile{{#1}}% + \ifx\@anim@gropts\@empty% + \edef\@anim@curfile{*{#1}}% + \else% + \edef\@anim@curfile{*[\@anim@gropts]{#1}}% + \fi% \global\setbox\@anim@box=\hbox{\expandafter\includegraphics\@anim@curfile}% } \fi @@ -947,28 +964,7 @@ \newcount\@anim@curframe \newcount\@anim@curframe@zb% zero based -%draftbox from file -\ifpdf - \def\@anim@filedraftbox#1{% #1: filename - %store file in a box - \def\@anim@mps{.mps}% - \ifx\@anim@ext\@anim@mps% - \global\setbox\@anim@box=\hbox{\convertMPtoPDF{#1}{1}{1}}% - \else% - \pdfximage{#1}% - \global\setbox\@anim@box=\hbox{\pdfrefximage\pdflastximage}% - \fi% - \@anim@draftbox{\@anim@box}% draw draft box with controls (if set) - } -\else - \def\@anim@filedraftbox#1{% - \edef\@anim@curfile{{#1}}% - \global\setbox\@anim@box=\hbox{\expandafter\includegraphics\@anim@curfile}% - \@anim@draftbox{\@anim@box}% - } -\fi - -%draftbox from savebox (lowlevel macro) +%draftbox from savebox \def\@anim@draftbox#1{% #1: box number %get size \xdef\@anim@animwidth{\strip@pt\wd#1}% @@ -1059,17 +1055,13 @@ \@anim@curframe=\@anim@first% \@anim@curframe@zb=0% \if@anim@draft% - %test for existence of all files of the sequence - \loop\ifnum\@anim@curframe>\@anim@last\else% - %get file name extension of current file (also tests for existence) - \@anim@getext{% - \@anim@base\@anim@pad{\@anim@first}{\the\@anim@curframe}% - }% - \advance\@anim@curframe by \@anim@every% - \advance\@anim@curframe@zb by \@ne% - \repeat% + %get file name extension + \@anim@getext{% + \@anim@base\@anim@pad{\@anim@first}{\the\@anim@curframe}% + }% + \@anim@filebox{\@anim@base\@anim@first\@anim@ext}% store file in a box %draw draftbox according to dimensions of the first frame - \@anim@filedraftbox{\@anim@base\@anim@first\@anim@ext}% + \@anim@draftbox{\@anim@box}% \else% \if@anim@controls% %create button faces only once in the current colour combination @@ -2001,6 +1993,18 @@ \define@key{anim@user}{every}{% embed every #1 frames \ifnum#1<\@ne\gdef\@anim@every{1}\else\gdef\@anim@every{#1}\fi% } +\define@key{anim@user}{bb}{% + \if@anim@grxloaded\xdef\@anim@gropts{\@anim@gropts, bb=#1}% + \else\@anim@missing{graphicx}\fi% +} +\define@key{anim@user}{viewport}{% + \if@anim@grxloaded\xdef\@anim@gropts{\@anim@gropts, viewport=#1}% + \else\@anim@missing{graphicx}\fi% +} +\define@key{anim@user}{trim}{% + \if@anim@grxloaded\xdef\@anim@gropts{\@anim@gropts, trim=#1}% + \else\@anim@missing{graphicx}\fi% +} %macro to reset macros and booleans \def\@anim@reset{% @@ -2037,6 +2041,7 @@ \@anim@begin={}% \@anim@end={}% \gdef\@anim@every{1}% frames to be included + \gdef\@anim@gropts{}% } %package options -- cgit v1.2.3