summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-11-29 14:20:55 +0000
committerNorbert Preining <preining@logic.at>2007-11-29 14:20:55 +0000
commit7674fdfd8ff8e191c3ca661562a72f8f15049e00 (patch)
tree9ca2cbcf5bbfed8b22568689932bff1d1fbe97da /Master/texmf-dist/tex
parent46c01a8363a5c5724540e0522784de465f6cf463 (diff)
animate update from ctan
git-svn-id: svn://tug.org/texlive/trunk@5645 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/animate/animate.sty83
1 files changed, 44 insertions, 39 deletions
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