summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pstool/pstool.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-24 22:25:38 +0000
committerKarl Berry <karl@freefriends.org>2009-05-24 22:25:38 +0000
commite9057cf08045a6afee19241b33794f857b9823d2 (patch)
tree2ae5748c44f66b35c763e255e5f69cdea4600e55 /Master/texmf-dist/source/latex/pstool/pstool.tex
parent1984fffaddfd95577875b13b1b44498a921a0004 (diff)
pstool update (24may09)
git-svn-id: svn://tug.org/texlive/trunk@13446 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/pstool/pstool.tex')
-rw-r--r--Master/texmf-dist/source/latex/pstool/pstool.tex41
1 files changed, 27 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/pstool/pstool.tex b/Master/texmf-dist/source/latex/pstool/pstool.tex
index 00773481d3b..a66b8981add 100644
--- a/Master/texmf-dist/source/latex/pstool/pstool.tex
+++ b/Master/texmf-dist/source/latex/pstool/pstool.tex
@@ -2,7 +2,7 @@
\begin{filecontents*}{README.txt}
__________________
The pstool package
-v1.1
+v1.2
A package like "pst-pdf" for processing PostScript graphics
with psfrag labels within pdfLaTeX documets. The difference
@@ -22,7 +22,7 @@ Copyright 2008
\end{filecontents*}
\begin{filecontents}{pstool.sty}
-\ProvidesPackage{pstool}[2009/04/24 v1.1
+\ProvidesPackage{pstool}[2009/05/24 v1.2
Wrapper for processing PostScript/psfrag figures]
% External packages
@@ -94,12 +94,14 @@ Copyright 2008
ps2pdf-options={},
pdfcrop-options={}}
-\ifshellescape\else
- \ExecuteOptionsX{process=none}
- \PackageWarning{pstool}{^^J\space\space%
- Package option [process=none] activated^^J\space\space
- because -shell-escape is not enabled.^^J%
- This warning occurred}
+\ifpdf\else
+ \ifshellescape\else
+ \ExecuteOptionsX{process=none}
+ \PackageWarning{pstool}{^^J\space\space%
+ Package option [process=none] activated^^J\space\space
+ because -shell-escape is not enabled.^^J%
+ This warning occurred}
+ \fi
\fi
\ProcessOptionsX
@@ -124,7 +126,9 @@ Copyright 2008
\edef\pstool@cmdsep{\ifwindows\string&\else\string;\fi\space}
\edef\pstool@rm@cmd{\ifwindows del \else rm -- \fi}
-% Delete a file if it exists (only the filename is supplied and the path is inferred):
+% Delete a file if it exists:\\
+% |#1|: path\\
+% |#2|: filename
\newcommand\pstool@rm[2]{%
\OnlyIfFileExists{#1#2}{%
\immediate\write18{%
@@ -232,8 +236,16 @@ Copyright 2008
\pstool@getpaths{#2}%
\pstool@process{#1}{#3}}
-\newcommand\pstool@neverprocess[3][]{%
- \pstool@includegraphics[#1]{#2}}
+\ifpdf
+ \newcommand\pstool@neverprocess[3][]{%
+ \pstool@includegraphics[#1]{#2}}
+\else
+ \newcommand\pstool@neverprocess[3][]{%
+ \begingroup
+ #3%
+ \pstool@includegraphics[#1]{#2}%
+ \endgroup}
+\fi
% For regular operation, which processes the figure only if
% the command is starred, or the PDF doesn't exist.
@@ -278,7 +290,7 @@ Copyright 2008
% And this is the main macro.
\newcommand\pstool@process[2]{%
- \pstool@echo@verbose{^^J=== pstool: begin processing ===}%
+ \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
@@ -300,10 +312,11 @@ Copyright 2008
\pstool@exe{ps2pdf}{\ip@directpath}{%
ps2pdf \pstool@pspdf@opts\space "\pstool@jobname.ps" "\ip@lastelement.pdf"}%
\fi
- \pstool@echo{^^J=== pstool: end processing ===^^J}%
\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}%
+}
% The file that is written for processing is set up to read the preamble of the original document and set the graphic on an empty page (cropping to size is done either here with \pkg{preview} or later with \pkg{pdfcrop}).
\def\pstool@write@processfile#1#2#3{%