diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/auto-pst-pdf/auto-pst-pdf.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/auto-pst-pdf/auto-pst-pdf.sty | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/auto-pst-pdf/auto-pst-pdf.sty b/Master/texmf-dist/tex/latex/auto-pst-pdf/auto-pst-pdf.sty index e44046fec02..8ff331eb208 100644 --- a/Master/texmf-dist/tex/latex/auto-pst-pdf/auto-pst-pdf.sty +++ b/Master/texmf-dist/tex/latex/auto-pst-pdf/auto-pst-pdf.sty @@ -8,10 +8,11 @@ %% __________________________________ %% Copyright (C) 2007 Will Robertson %% License information appended. -\ProvidesPackage{auto-pst-pdf}[2008/03/14 v0.5 Wrapper for pst-pdf] +\ProvidesPackage{auto-pst-pdf}[2009/04/26 v0.6 Wrapper for pst-pdf] \RequirePackage{ifpdf,xkeyval,ifplatform} \newif\if@app@off@ \newif\if@app@crop@ +\newcounter{app@runs} \def\app@suffix{autopp} \edef\app@jobname{\jobname-\app@suffix} \edef\app@pics{\jobname-pics.pdf} @@ -37,18 +38,31 @@ \DeclareOptionX{dvips}{\def\app@dvips@opts{#1}} \DeclareOptionX{pspdf}{\def\app@pspdf@opts{#1}} \DeclareOptionX{pdfcrop}{\def\app@pdfcrop@opts{#1}} + \DeclareOptionX{cleanup}{% \let\app@rm@files\@empty \@for\@ii:=#1\do{% \edef\app@rm@files{\app@rm@files,\app@jobname.\@ii}}} + +\DeclareOptionX{runs}{% + \setcounter{app@runs}{#1}% support calc + \ifnum\c@app@runs > \z@ + \else + \app@PackageWarning{The number of runs must be at least one.}% + \c@app@runs\@ne + \fi} + +\DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{pst-pdf}} + \ExecuteOptionsX{% ext=tex, crop=on, latex={}, dvips={-Ppdf}, - pspdf={}, pdfcrop={}, - cleanup={log,aux,dvi,ps,pdf}} + cleanup={log,aux,dvi,ps,pdf}, + runs=1 +} \ifwindows \ExecuteOptionsX{pspdf={}} \else @@ -71,6 +85,10 @@ \def\app@compile{% \app@cleanup \app@remove@container + \loop\ifnum\c@app@runs > \@ne + \app@convert{extralatex}{\jobname.\app@ext}{\app@jobname.dvi}% + \advance\c@app@runs\m@ne + \repeat \app@convert{latex}{\jobname.\app@ext}{\app@jobname.dvi}% \app@convert{dvips}{\app@jobname.dvi}{\app@jobname.ps}% \if@app@crop@ @@ -90,7 +108,9 @@ \def\app@remove@container{\app@try@rm{\app@pics}} \def\app@cleanup{\app@try@rm{\app@rm@files}} \def\app@cmd@latex#1#2{latex \app@latex@opts\space - "\let\noexpand\APPmakepictures\noexpand\empty\noexpand\input #1"} + "\unexpanded{\let\APPmakepictures\empty\input} #1"} +\def\app@cmd@extralatex#1#2{latex \app@latex@opts\space + "\unexpanded{\let\APPmakepictures\undefined\input} #1"} \def\app@cmd@dvips#1#2{dvips \app@dvips@opts\space -o "#2" "#1"} \def\app@cmd@pstopdf#1#2{ps2pdf \app@pspdf@opts\space "#1" "#2"} \def\app@cmd@pdfcrop#1#2{pdfcrop \app@pdfcrop@opts\space "#1" "#2"} |