diff options
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/auto-pst-pdf/auto-pst-pdf.dtx | 121 |
1 files changed, 61 insertions, 60 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 7976b97fd4b..49fbc84972f 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,7 +5,7 @@ %<*readme> ________________________ The auto-pst-pdf package -v0.4 2007/11/18 +v0.5 2008/03/14 The package uses -shell-escape to execute pst-pdf. This makes it especially easy to integrate into the @@ -17,11 +17,6 @@ features so that Matlab figures via laprint, Mathematica figures via MathPSfrag, and regular psfrag figures can all be input consistently and easily. -v0.4 adds options to change the commandline flags -passed to the auxiliary programs, improves robustness -and flexibility, and simplifies the output from using -the package. - Will Robertson - wspr 81 at gmail dot com Johannes Große @@ -132,7 +127,8 @@ This work consists of the file auto-pst-pdf.dtx % \note{\url{http://www.ctan.org/tex-archive/help/Catalogue/entries/psfrag.html}} % wrapper is provided. % -% \begin{tabular}{@{}lp{7cm}} +% \begin{trivlist}\item[] +% \begin{tabular}{@{\hskip 2em}lp{7cm}} % \cmd\mathfig\marg{filename} & \raggedright % insert a Mathematica graphic from \pkg{MathPSfrag} % (without |-psfrag| suffix)\arraybackslash \\ @@ -141,14 +137,24 @@ This work consists of the file auto-pst-pdf.dtx % \cmd\psfragfig\marg{filename} & % insert an \EPS\ with \pkg{psfrag} % \end{tabular} +% \end{trivlist} +% +% \noindent The above commands all accept an optional argument +% which is passed to the underlying \cmd\includegraphics\ macro. +% +% The \cmd\matlabfig\ command meddles slightly with the output of +% \pkg{laprint}; the font sizes in the figure will always be as +% originally defined. (This is unavoidable I'm afraid.) % -% \noindent % For the \cmd\psfragfig\ command, \pkg{psfrag} statements are input % from either or both of the files \meta{document}|-psfrag.tex| and -% \meta{filename}|-psfrag.tex| if they exist. +% \meta{filename}|-psfrag.tex| if they exist. Furthermore, supplementary +% \cmd\psfrag\ statements can be added in a trailing optional argument:\par +% |\psfrag|\oarg{graphics options}\marg{filename}\oarg{psfrag statements} +% +% \noindent Manual \cmd\psfrag s override those in \meta{filename}|-psfrag.tex| +% which in turn override those in \meta{document}|-psfrag.tex|. % -% The above commands all accept an optional argument -% which is passed to the underlying \cmd\includegraphics\ macro. % % \section{Advanced package options}\label{sec:opt} % @@ -170,12 +176,10 @@ This work consists of the file auto-pst-pdf.dtx % % {\color{gray}|\usepackage[|\color{niceblue}|latex={-interaction=nonstopmode}|\color{gray}|]{auto-pst-pdf}|} % -% \section{Customisation} % -% If you want to customise the auxiliary process, this package provides -% the |delay| package option that does not execute the \pkg{pst-pdf} -% processing. Then the \cmd\app@compile\ macro can be re-defined to do whatever you like -% and the macro \cmd\CompilePics\ will invoke the auxiliary process. +% \section{Acknowledgements} +% +% Many thanks to the authors of \pkg{pst-pdf}, \pkg{psfrag}, \pkg{laprint}, \pkg{MathPSfrag}, and \pkg{pdfcrop}. This package could not exist without their combined efforts over many years. Finally, Gernot \textsc{Hassenfplug} deserves special mention for extensive testing, feature suggestions, and moral support |:)| Thanks, mate. % % \StopEventually{} % @@ -191,10 +195,11 @@ This work consists of the file auto-pst-pdf.dtx % This is the package. % % \begin{macrocode} -\ProvidesPackage{auto-pst-pdf}[2007/11/18 v0.4 Wrapper for pst-pdf] +\ProvidesPackage{auto-pst-pdf}[2008/03/14 v0.5 Wrapper for pst-pdf] % \end{macrocode} % % \PrintChanges +% \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.} @@ -208,7 +213,6 @@ This work consists of the file auto-pst-pdf.dtx % \paragraph{Things we need} % \begin{macrocode} \newif\if@app@off@ -\newif\if@app@delay@ \newif\if@app@crop@ \def\app@suffix{autopp} \edef\app@jobname{\jobname-\app@suffix} @@ -226,7 +230,6 @@ This work consists of the file auto-pst-pdf.dtx \fi} \DeclareOptionX{on}[]{\@app@off@false} \DeclareOptionX{ext}{\def\app@ext{#1}} -\DeclareOptionX{delay}{\@app@delay@true} \DeclareOptionX{latex}{% \def\app@latex@opts{% \ifwindows @@ -286,8 +289,9 @@ This work consists of the file auto-pst-pdf.dtx \def\app@convert#1#2#3{% \OnlyIfFileExists{#2}{% \app@exe{\csname app@cmd@#1\endcsname{#2}{#3}}% - \NotIfFileExists{#3}{\app@PackageError{Creation of #3 failed.}}}} + \NotIfFileExists{#3}{\app@PackageWarning{Creation of #3 failed.}}}} % \end{macrocode} +% \changes{v0.5}{2007/11/21}{Fix PackageError (should have been a warning).} % \end{macro} % % \begin{macro}{\app@compile} @@ -363,58 +367,48 @@ This work consists of the file auto-pst-pdf.dtx % \begin{macrocode} \ifpdf \if@app@off@\else - \newcommand\CompilePics{% - \ifshellescape - \app@exe{echo " "} - \app@exe{echo "-------------------------------------------------"} - \app@exe{echo "auto-pst-pdf: Auxiliary LaTeX compilation"} - \app@exe{echo "-------------------------------------------------"} - \app@compile - \app@exe{echo "-------------------------------------------------"} - \app@exe{echo "auto-pst-pdf: End auxiliary LaTeX compilation"} - \app@exe{echo "-------------------------------------------------"} - \else - \app@PackageError{% - "shell escape" (or "write18") is not enabled:\app@nl - auto-pst-pdf will not work!} - {You need to run LaTeX with the equivalent of - "pdflatex -shell-escape"\app@nl - Or turn off auto-pst-pdf.} - \fi} -% \end{macrocode} -% Execute the compilation process unless the user is daring and wishes to do so themselves: -% \begin{macrocode} - \if@app@delay@\else\CompilePics\fi + \ifshellescape + \app@exe{echo " "} + \app@exe{echo "-------------------------------------------------"} + \app@exe{echo "auto-pst-pdf: Auxiliary LaTeX compilation"} + \app@exe{echo "-------------------------------------------------"} + \app@compile + \app@exe{echo "-------------------------------------------------"} + \app@exe{echo "auto-pst-pdf: End auxiliary LaTeX compilation"} + \app@exe{echo "-------------------------------------------------"} + \else + \app@PackageError{% + "shell escape" (or "write18") is not enabled:\app@nl + auto-pst-pdf will not work!} + {You need to run LaTeX with the equivalent of + "pdflatex -shell-escape"\app@nl + Or turn off auto-pst-pdf.}% + \fi \fi \if@app@crop@ \PassOptionsToPackage{notightpage}{pst-pdf} \fi % \end{macrocode} +% \changes{v0.5}{2008/03/14}{Removed mucking about with image extensions.} % % \paragraph{\LaTeX\ compilation} % Either we're calling |latex| from within a pdf\LaTeX\ run (see above) or the document is being compiled as usual. % \begin{macrocode} \else % \end{macrocode} +% \LaTeX\ compilation from scratch (as in `|latex| \meta{document}|.tex|`) --- here the |postscript| environment does nothing and document is processed `normally': +% \changes{v0.5}{2007/11/22}{Removed \cs{ifdefined} to avoid e-\TeX.} +% \begin{macrocode} + \ifx\APPmakepictures\@undefined + \PassOptionsToPackage{inactive}{pst-pdf} +% \end{macrocode} % \LaTeX\ compilation induced by this package: % \begin{macrocode} - \ifdefined\APPmakepictures + \else \if@app@crop@ \PassOptionsToPackage{notightpage}{pst-pdf} \fi -% \end{macrocode} -% \LaTeX\ compilation from scratch (as in `|latex| \meta{document}|.tex|`) --- here the |postscript| environment does nothing and document is processed `normally': -% \begin{macrocode} - \else - \PassOptionsToPackage{inactive}{pst-pdf} \fi -% \end{macrocode} -% Bug fix for |pst-pdf| (apparently): -% \begin{macrocode} - \AtBeginDocument{% - \gdef\ppf@other@extensions{.png,.pdf,.jpg,.jpeg,.PNG,.PDF,.JPG,.JPEG} - \edef\Gin@extensions{\Gin@extensions,.mps} - \DeclareGraphicsRule{.mps}{eps}{*}{}} \fi % \end{macrocode} % @@ -432,8 +426,8 @@ This work consists of the file auto-pst-pdf.dtx % psfrag-related packages. This provides a consistent and easy way to % include such figures in the document. % -% Please suggest wrappers for other packages that output psfrag -% (for example: SciLab, R, Maple, LabView, ... ?) +% Please suggest wrappers for other packages that output psfrag figures +% (for example: SciLab, R, Maple, LabView, Sage, ... ?) % % \begin{macro}{\matlabfig} % We need to disable the scaling that laprint applies @@ -444,10 +438,12 @@ This work consists of the file auto-pst-pdf.dtx \let\app@ig\includegraphics \newcommand\matlabfig[2][]{% \begin{postscript} - \renewcommand\includegraphics[2][]{\app@ig[#1]{##2}} - \input{#2} + \renewcommand\resizebox[3]{##3}% + \renewcommand\includegraphics[2][]{\app@ig[#1]{##2}}% + \input{#2}% \end{postscript}} % \end{macrocode} +% \changes{v0.5}{2007/11/21}{Redefine \cmd\resizebox\ for \texttt{laprint}.} % \end{macro} % % \begin{macro}{\mathfig} @@ -469,16 +465,21 @@ This work consists of the file auto-pst-pdf.dtx % inserted. % \begin{macrocode} \newcommand\psfragfig[2][]{% + \@ifnextchar[ + {\app@psfragfig[#1]{#2}} + {\app@psfragfig[#1]{#2}[]}} +\def\app@psfragfig[#1]#2[#3]{% \begin{postscript} \InputIfFileExists{#2-psfrag}{}{}% + #3 \includegraphics[#1]{#2}% \end{postscript}} % \end{macrocode} % Finally, input any psfrag commands associated with the document: -% (actually, does this work?!?) % \begin{macrocode} \InputIfFileExists{\jobname-psfrag}{}{} % \end{macrocode} +% \changes{v0.5}{2007/11/21}{Extend \cmd\psfragfig\ to accept arbitrary input for extra \cmd\psfrag\ commands.} % \end{macro} % % \end{subsection} |