summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pstool
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-03-11 23:21:52 +0000
committerKarl Berry <karl@freefriends.org>2013-03-11 23:21:52 +0000
commit71010177fbcee3901fdeccfdca55500eaa211b44 (patch)
treed813b2914855bdcca60934327b0b87a72f993d9a /Master/texmf-dist/tex/latex/pstool
parent43501b14c11da09f8e269e70521b541c3a606848 (diff)
pstool (11mar13)
git-svn-id: svn://tug.org/texlive/trunk@29343 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pstool')
-rw-r--r--Master/texmf-dist/tex/latex/pstool/pstool.sty17
1 files changed, 6 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/pstool/pstool.sty b/Master/texmf-dist/tex/latex/pstool/pstool.sty
index 37f31108ec6..c29683cf6f8 100644
--- a/Master/texmf-dist/tex/latex/pstool/pstool.sty
+++ b/Master/texmf-dist/tex/latex/pstool/pstool.sty
@@ -1,6 +1,6 @@
% TODO: convert this package into expl3 syntax (will save many lines of code).
-\ProvidesPackage{pstool}[2013/02/11 v1.5
+\ProvidesPackage{pstool}[2013/03/11 v1.5a
Wrapper for processing PostScript/psfrag figures]
% External packages:
@@ -452,20 +452,18 @@
% 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{%
+ \immediate\openout\pstool@out #2\pstool@suffix.tex\relax
% Put down a label so we can pass through the current page number:
\edef\pstool@label{pstool-\pstool@path\pstool@filestub}%
\protected@write\@auxout{}%
{\string\newlabel{\pstool@label}{{\@currentlabel}{\the\c@page}}}%
- \immediate\openout\pstool@out #2\pstool@suffix.tex\relax
-% And copy the main file's bbl file too:
-% (necessary for biblatex)
+% And copy the main file's bbl file too: (necessary only for biblatex)
\IfFileExists{\jobname.bbl}{%
\IfFileExists{\pstool@path\pstool@jobname.bbl}{%
\immediate\write18{\pstool@rm@cmd \pstool@path\pstool@jobname.bbl}%
}{}%
+ \immediate\write18{\pstool@cp@cmd \jobname.bbl \pstool@path\pstool@jobname.bbl}%
}{}%
-\immediate\write18{\pstool@cp@cmd \jobname.bbl \pstool@path\pstool@jobname.bbl}%
-%
% Scan the main document line by line; print preamble into auxiliary file until the document begins or \cs{EndPreamble} is found:
\endlinechar=-1
\def\@tempa{\pdfoutput=0\relax}%
@@ -490,7 +488,6 @@
\fi
}
\closein\pstool@mainfile@ior
-%
% Now the preamble of the process file:
\immediate\write\pstool@out{%
\if@pstool@pdfcrop@\else
@@ -500,7 +497,8 @@
\pagestyle{empty}^^J^^J% remove the page number
}%
\noexpand\makeatletter^^J%
-% Sort out the page numbering:
+% Sort out the page numbering here.
+% Force the pagestyle locally to output an integer so it can be written to the external file inside a \cs{setcounter} command.
\expandafter\ifx\csname r@\pstool@label\endcsname\relax\else
\def\noexpand\thepage{\unexpanded\expandafter{\thepage}}^^J%
\noexpand\setcounter{page}{%
@@ -508,7 +506,6 @@
\@secondoftwo\csname r@\pstool@label\endcsname
}^^J%
\fi
-%
% And the document body to place the graphic on a page of its own:
\noexpand\@input{\jobname.oldaux}^^J^^J%
\noexpand\begin{document}^^J%
@@ -616,11 +613,9 @@
\edef\@tempa{%
\unexpanded{\pstool#3[#1]}{\pstool@eps}{%
\ifx\pstool@macrofile\@empty\else
- \@percentchar Input main macro file:^^J
\unexpanded{\csname @input\endcsname}{\pstool@macrofile}%
\fi
\ifx\pstool@tex\@empty\else
- \@percentchar Input macro file for this graphic:^^J
\unexpanded{\csname @input\endcsname}{\pstool@tex}%
\fi
\unexpanded{#4}%