diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/auto-pst-pdf/auto-pst-pdf.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/auto-pst-pdf/auto-pst-pdf.dtx | 68 |
1 files changed, 58 insertions, 10 deletions
diff --git a/Master/texmf-dist/source/latex/auto-pst-pdf/auto-pst-pdf.dtx b/Master/texmf-dist/source/latex/auto-pst-pdf/auto-pst-pdf.dtx index 29c030f9800..51f2ebb2b8d 100644 --- a/Master/texmf-dist/source/latex/auto-pst-pdf/auto-pst-pdf.dtx +++ b/Master/texmf-dist/source/latex/auto-pst-pdf/auto-pst-pdf.dtx @@ -5,9 +5,12 @@ %<*readme> ________________________ The auto-pst-pdf package -v0.5 2008/03/14 - -The package uses -shell-escape to execute pst-pdf. +v0.6 2009/04/26 + +This package uses -shell-escape (or "write18") to +automatically perform the extra compilations +required for the "pst-pdf" package. + This makes it especially easy to integrate into the workflow of an editor with just "LaTeX" and "pdfLaTeX" buttons. @@ -91,11 +94,21 @@ This work consists of the file auto-pst-pdf.dtx % % \maketitle % +% \section{Future plans} +% This package is no longer being actively developed +% (although I'm happy to add small features and fix bugs). I (Will Robertson) first +% wrote \pkg{auto-pst-pdf} to aid the use of \pkg{psfrag} in pdf\LaTeX\ documents. The newer +% \pkg{pstool} package does this in a more efficient and convenient manner, +% and I suggest using that package instead if that's what you're using this package for. +% However, \pkg{pstool} does not yet support full \pkg{pst-pdf} usage, so \pkg{auto-pst-pdf} +% is certainly not deprecated yet. +% % \section{Basic usage} % This package provides a wrapper around \pkg{pst-pdf} to automatically % accomodate for typesetting either with \DVI\ or \PDF\ output. With % default package option |[on]|, typesetting under pdf\/\LaTeX\ will -% automatically initiate an auxiliary compilation of \LaTeX $\to$ |dvips| $\to$ |ps2pdf| $\to$ |pdfcrop| to generate the required \PDF\ figures for the document. +% automatically initiate an auxiliary compilation of \LaTeX $\to$ |dvips| +% $\to$ |ps2pdf| $\to$ |pdfcrop| to generate the required \PDF\ figures for the document. % % After this has been done and the figures no longer need to be % re-generated, the package can be given the |[off]| option to save @@ -168,6 +181,12 @@ This work consists of the file auto-pst-pdf.dtx % {\color{gray}|\usepackage[|\color{niceblue}|cleanup={log,aux,dvi,ps,pdf}|\color{gray}|]{auto-pst-pdf}|} % % \bigskip\noindent +% If you're using cross-references of any kind within the graphics being processed by +% \pkg{pst-pdf}, it will be necessary to perform the auxiliary compilation more than once +% to resolve them. The exact number will vary by exact application, and must be set explicitly:\par +% {\color{gray}|\usepackage[|\color{niceblue}|runs=2|\color{gray}|]{auto-pst-pdf}|} +% +% \bigskip\noindent % The options passed individually to |latex|, |dvips|, |ps2pdf|, and |pdfcrop| in the auxiliary compilation process may all be customised, if you know what you're doing. The defaults for the latter three are\par % {\color{gray}|\usepackage[|{\color{niceblue}|dvips={-o -Ppdf}|}|,|}\par % {\color{white}|\usepackage[|{\color{niceblue}|pspdf={-dAutoRotatePages=/None}}|}\color{gray}|,|}\par @@ -178,6 +197,13 @@ This work consists of the file auto-pst-pdf.dtx % % {\color{gray}|\usepackage[|\color{niceblue}|latex={-interaction=nonstopmode}|\color{gray}|]{auto-pst-pdf}|} % +% \bigskip\noindent +% Any package options that are not recognised are passed on to \pkg{pst-pdf}. As an example, +% +% {\color{gray}|\usepackage[|\color{niceblue}|final|\color{gray}|]{auto-pst-pdf}|} +% +% \noindent will load \pkg{pst-pdf} with the \texttt{final} package option, possibly overriding +% a global \texttt{draft} option from the class loading. % % \section{Acknowledgements} % @@ -197,11 +223,13 @@ This work consists of the file auto-pst-pdf.dtx % This is the package. % % \begin{macrocode} -\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] % \end{macrocode} % % \PrintChanges -% \changes{v0.5}{2007/11/22}{\texttt{delay} option removed. Keep it simple, stupid!} +% \changes{v0.6}{2009/04/26}{Pass unknown options to \pkg{pst-pdf}.} +% \changes{v0.6}{2009/04/26}{\texttt{runs} option added (thanks Joseph!!)} +% \changes{v0.5}{2007/11/22}{\texttt{delay} option removed. Keep it simple, stupid!!} % \changes{v0.4}{2007/11/11}{Will sorted it all out.} % \changes{v0.4}{2007/11/09}{Johannes tinkered with the code. Will will improve. :-)} % \changes{v0.3}{2007/11/09}{Too many changes to list. Command execution totally re-written.} @@ -216,6 +244,7 @@ This work consists of the file auto-pst-pdf.dtx % \begin{macrocode} \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} @@ -245,18 +274,31 @@ This work consists of the file auto-pst-pdf.dtx \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 @@ -302,6 +344,10 @@ This work consists of the file auto-pst-pdf.dtx \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@ @@ -341,8 +387,10 @@ This work consists of the file auto-pst-pdf.dtx % \end{macrocode} % \LaTeX: % \begin{macrocode} -\def\app@cmd@latex#1#2{latex \app@latex@opts\space - "\let\noexpand\APPmakepictures\noexpand\empty\noexpand\input #1"} +\def\app@cmd@latex#1#2{latex \app@latex@opts\space + "\unexpanded{\let\APPmakepictures\empty\input} #1"} +\def\app@cmd@extralatex#1#2{latex \app@latex@opts\space + "\unexpanded{\let\APPmakepictures\undefined\input} #1"} % \end{macrocode} % |dvips|: % \begin{macrocode} |