summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-25 22:42:05 +0000
committerKarl Berry <karl@freefriends.org>2009-05-25 22:42:05 +0000
commit950d5b4a832282a5069087ff654f1d456c7335bf (patch)
tree8862b9d4abd73aa4d7348198a4fca9179ba66194 /Master/texmf-dist/tex
parent626454e48b11b9227eabcec45cf2adc433a7af1f (diff)
pstool update (25may09)
git-svn-id: svn://tug.org/texlive/trunk@13462 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/pstool/pstool.sty68
1 files changed, 36 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/pstool/pstool.sty b/Master/texmf-dist/tex/latex/pstool/pstool.sty
index a93490a816a..dfb1d7d0e5d 100644
--- a/Master/texmf-dist/tex/latex/pstool/pstool.sty
+++ b/Master/texmf-dist/tex/latex/pstool/pstool.sty
@@ -1,18 +1,17 @@
%% LaTeX2e file `pstool.sty'
%% generated by the `filecontents' environment
-%% from source `pstool' on 2009/05/24.
+%% from source `pstool' on 2009/05/25.
%%
-\ProvidesPackage{pstool}[2009/05/24 v1.2
+\ProvidesPackage{pstool}[2009/05/25 v1.2a
Wrapper for processing PostScript/psfrag figures]
% External packages
\RequirePackage{%
- catchfile,color,ifpdf,ifplatform,graphicx,psfrag,suffix,xkeyval}
+ catchfile,color,ifpdf,ifplatform,
+ graphicx,psfrag,suffix,xkeyval}
\RequirePackage{inversepath}[2008/07/31 v0.2]
% Allocations
-\newif\if@pstool@always@
-\newif\if@pstool@never@
\newif\if@pstool@pdfcrop@
\newif\if@pstool@verbose@
\newwrite\pstool@out
@@ -23,7 +22,8 @@
% \subsection{Package options}
-\define@choicekey*{pstool.sty}{crop}[\@tempa\@tempb]{preview,pdfcrop}{%
+\define@choicekey*{pstool.sty}{crop}
+ [\@tempa\@tempb]{preview,pdfcrop}{%
\ifcase\@tempb\relax
\@pstool@pdfcrop@false
\or
@@ -32,14 +32,9 @@
\fi
}
-\define@choicekey*{pstool.sty}{process}[\@tempa\@tempb]{all,none,auto}{%
- \ifcase\@tempb\relax
- \@pstool@always@true
- \or
- \@pstool@never@true
- \or
- \fi
-}
+\define@choicekey*{pstool.sty}{process}
+ [\@tempa\pstool@process@choice]{all,none,auto}{}
+\ExecuteOptionsX{process=auto}
\define@choicekey*{pstool.sty}{mode}
[\@tempa\@tempb]{errorstop,nonstop,batch}{%
@@ -74,7 +69,7 @@
ps2pdf-options={},
pdfcrop-options={}}
-\ifpdf\else
+\ifpdf
\ifshellescape\else
\ExecuteOptionsX{process=none}
\PackageWarning{pstool}{^^J\space\space%
@@ -89,7 +84,7 @@
% \section{Macros}
% Used to echo information to the console output.
-% Can't use \typeout because it's asynchronous with
+% Can't use |\typeout| because it's asynchronous with
% any |\immediate\write18| processes (for some reason).
\def\pstool@echo#1{%
\if@pstool@verbose@
@@ -242,21 +237,21 @@
}}
% \section{User commands}
-% Finally, define \cmd\pstool\ as appropriate for the mode:
+% Finally, define \cmd\pstool\ as appropriate for the mode: (|all|, |none|, |auto|, respectively)
\ifpdf
- \if@pstool@always@
+ \ifcase\pstool@process@choice
\let\pstool\pstool@alwaysprocess
\WithSuffix\def\pstool!{\pstool@alwaysprocess}
\WithSuffix\def\pstool*{\pstool@alwaysprocess}
- \else\if@pstool@never@
+ \or
\let\pstool\pstool@neverprocess
\WithSuffix\def\pstool!{\pstool@neverprocess}
\WithSuffix\def\pstool*{\pstool@neverprocess}
- \else
+ \or
\let\pstool\pstool@maybeprocess
\WithSuffix\def\pstool!{\pstool@neverprocess}
\WithSuffix\def\pstool*{\pstool@alwaysprocess}
- \fi\fi
+ \fi
\else
\let\pstool\pstool@neverprocess
\WithSuffix\def\pstool!{\pstool@neverprocess}
@@ -270,8 +265,10 @@
% And this is the main macro.
\newcommand\pstool@process[2]{%
- \pstool@echo@verbose{^^J^^J=== pstool: begin processing ===}%
- \pstool@write@processfile{#1}{\ip@directpath\ip@lastelement}{#2}%
+ \pstool@echo@verbose{%
+ ^^J^^J=== pstool: begin processing ===}%
+ \pstool@write@processfile{#1}
+ {\ip@directpath\ip@lastelement}{#2}%
\pstool@exe{auxiliary process: \ip@lastelement\space}
{./}{latex
-shell-escape
@@ -282,19 +279,25 @@
"\pstool@jobname.tex"}%
% Execute dvips in quiet mode if latex is not run in (non/error)stop mode:
\pstool@exe{dvips}{\ip@directpath}{%
- dvips \if@pstool@verbose@\else -q \fi -Ppdf \pstool@dvips@opts\space "\pstool@jobname.dvi"}%
+ dvips \if@pstool@verbose@\else -q \fi -Ppdf
+ \pstool@dvips@opts\space "\pstool@jobname.dvi"}%
\if@pstool@pdfcrop@
\pstool@exe{ps2pdf}{\ip@directpath}{%
- ps2pdf \pstool@pspdf@opts\space "\pstool@jobname.ps" "\pstool@jobname.pdf"}%
+ ps2pdf \pstool@pspdf@opts\space
+ "\pstool@jobname.ps" "\pstool@jobname.pdf"}%
\pstool@exe{pdfcrop}{\ip@directpath}{%
- pdfcrop \pstool@pdfcrop@opts\space "\pstool@jobname.pdf" "\ip@lastelement.pdf"}%
+ pdfcrop \pstool@pdfcrop@opts\space
+ "\pstool@jobname.pdf" "\ip@lastelement.pdf"}%
\else
\pstool@exe{ps2pdf}{\ip@directpath}{%
- ps2pdf \pstool@pspdf@opts\space "\pstool@jobname.ps" "\ip@lastelement.pdf"}%
+ ps2pdf \pstool@pspdf@opts\space
+ "\pstool@jobname.ps" "\ip@lastelement.pdf"}%
\fi
\pstool@endprocess{%
\pstool@cleanup
- \pstool@includegraphics[#1]{\ip@directpath\ip@lastelement}}%
+ \pstool@includegraphics[#1]{%
+ \ip@directpath\ip@lastelement}%
+ }%
\pstool@echo@verbose{^^J=== pstool: end processing ===^^J}%
}
@@ -302,10 +305,9 @@
\def\pstool@write@processfile#1#2#3{%
\immediate\openout\pstool@out #2\pstool@suffix.tex\relax
\immediate\write\pstool@out{%
- \noexpand\pdfoutput=0^^J% force DVI mode if not already
-%
% Input the main document; redefine the document environment so only the preamble is read:
\unexpanded{%
+ \pdfoutput=0^^J% force DVI mode if not already
\let\origdocument\document^^J%
\let\EndPreamble\endinput^^J%
\def\document{\endgroup\endinput}^^J}%
@@ -390,7 +392,8 @@
\edef\pstool@tex{#2-psfrag.tex}%
\OnlyIfFileExists{#2.tex}{%
\PackageWarning{pstool}{%
- File "#2.tex" exists that may contain macros for "\pstool@eps.eps"^^J%
+ File "#2.tex" exists that may contain macros
+ for "\pstool@eps.eps"^^J%
But file "#2-psfrag.tex" is being used instead.%
}%
}%
@@ -408,7 +411,8 @@
\ifx\pstool@tex\@empty
\pstool#3[#1]{\pstool@eps}{#4}%
\else
- \expandafter\pstool@@@psfragfig\expandafter{\pstool@tex}{#3[#1]}{#4}%
+ \expandafter\pstool@@@psfragfig
+ \expandafter{\pstool@tex}{#3[#1]}{#4}%
\fi
}