summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pstool
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/pstool')
-rw-r--r--Master/texmf-dist/tex/latex/pstool/pstool.sty41
1 files changed, 27 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/pstool/pstool.sty b/Master/texmf-dist/tex/latex/pstool/pstool.sty
index 2066b5f25fd..a93490a816a 100644
--- a/Master/texmf-dist/tex/latex/pstool/pstool.sty
+++ b/Master/texmf-dist/tex/latex/pstool/pstool.sty
@@ -1,8 +1,8 @@
%% LaTeX2e file `pstool.sty'
%% generated by the `filecontents' environment
-%% from source `pstool' on 2009/04/24.
+%% from source `pstool' on 2009/05/24.
%%
-\ProvidesPackage{pstool}[2009/04/24 v1.1
+\ProvidesPackage{pstool}[2009/05/24 v1.2
Wrapper for processing PostScript/psfrag figures]
% External packages
@@ -74,12 +74,14 @@
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
@@ -104,7 +106,9 @@
\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{%
@@ -212,8 +216,16 @@
\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.
@@ -258,7 +270,7 @@
% 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
@@ -280,10 +292,11 @@
\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{%