summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-07-22 22:47:33 +0000
committerKarl Berry <karl@freefriends.org>2009-07-22 22:47:33 +0000
commitc3e77d64d6cd4a78f811f055c8e66fad01d86afd (patch)
tree691ea5bd93df429ff5e7f81edbc239d35c5f7820 /Master
parent20e5e430bf97131e6017ba654705d49ec2cf28dd (diff)
pstool 1.3 (22jul09)
git-svn-id: svn://tug.org/texlive/trunk@14373 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/pstool/.tex16
-rw-r--r--Master/texmf-dist/doc/latex/pstool/README17
-rw-r--r--Master/texmf-dist/doc/latex/pstool/example.aux4
-rw-r--r--Master/texmf-dist/doc/latex/pstool/example.log536
-rw-r--r--Master/texmf-dist/doc/latex/pstool/example.pdfbin13318 -> 54480 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pstool/example.synctex204
-rw-r--r--Master/texmf-dist/doc/latex/pstool/example.tex2
-rw-r--r--Master/texmf-dist/doc/latex/pstool/pstool.pdfbin425798 -> 456847 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pstool/subdir/trial2-psfrag.pdfbin0 -> 8487 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pstool/trial.pdfbin0 -> 10520 bytes
-rw-r--r--Master/texmf-dist/source/latex/pstool/pstool.ins2
-rw-r--r--Master/texmf-dist/source/latex/pstool/pstool.tex351
-rw-r--r--Master/texmf-dist/tex/latex/pstool/pstool.sty261
13 files changed, 1143 insertions, 250 deletions
diff --git a/Master/texmf-dist/doc/latex/pstool/.tex b/Master/texmf-dist/doc/latex/pstool/.tex
new file mode 100644
index 00000000000..3c2f1bb730f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pstool/.tex
@@ -0,0 +1,16 @@
+\pdfoutput =0
+\let \origdocument \document
+\let \EndPreamble \endinput
+\def \document {\endgroup \endinput }
+\input {example}
+\usepackage [active,tightpage]{preview}
+\let \document \origdocument
+\pagestyle {empty}
+\begin {document}
+\centering \null \vfill
+\begin {preview}
+\or
+\includegraphics []{\relax }
+\end {preview}
+\vfill \end {document}
+
diff --git a/Master/texmf-dist/doc/latex/pstool/README b/Master/texmf-dist/doc/latex/pstool/README
index 461bcc848f4..eb8a115643b 100644
--- a/Master/texmf-dist/doc/latex/pstool/README
+++ b/Master/texmf-dist/doc/latex/pstool/README
@@ -1,6 +1,6 @@
__________________
The pstool package
-v1.2b
+v1.3
A package like "pst-pdf" for processing PostScript graphics
with psfrag labels within pdfLaTeX documets. The difference
@@ -12,8 +12,19 @@ Running `latex` on pstool.tex will produce the files
pstool.ins, pstool.sty, and README.txt,
and compile the PDF documentation.
-Executing `tex pstool.ins` produces the files above
+Executing `latex pstool.ins` produces the files above
except pstool.ins (and the PDF file, obviously).
+Please see the PDF documentation for further information.
+
Will Robertson & Zebb Prime
-Copyright 2008
+Copyright 2008-2009
+
+____________________
+Brief change history
+
+v1.3, July 2009:
+ - [bitmap] option to control compression of bitmap graphics,
+ - Package options may now be set anywhere with \pstoolsetup{},
+ - localised pstool options can be set per-graphic.
+
diff --git a/Master/texmf-dist/doc/latex/pstool/example.aux b/Master/texmf-dist/doc/latex/pstool/example.aux
new file mode 100644
index 00000000000..73a39c44956
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pstool/example.aux
@@ -0,0 +1,4 @@
+\relax
+\providecommand*{\memsetcounter}[2]{}
+\memsetcounter{lastsheet}{1}
+\memsetcounter{lastpage}{1}
diff --git a/Master/texmf-dist/doc/latex/pstool/example.log b/Master/texmf-dist/doc/latex/pstool/example.log
new file mode 100644
index 00000000000..7bdcdb6564d
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pstool/example.log
@@ -0,0 +1,536 @@
+This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009) (format=pdflatex 2009.7.15) 21 JUL 2009 10:53
+entering extended mode
+ \write18 enabled.
+ %&-line parsing enabled.
+**example.tex
+(./example.tex
+LaTeX2e <2005/12/01>
+Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
+yphenation, german-x-2009-06-19, ngerman-x-2009-06-19, ancientgreek, ibycus, ar
+abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc
+h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono
+greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, la
+tin, latvian, lithuanian, mongolian, mongolian2a, bokmal, nynorsk, polish, port
+uguese, romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedi
+sh, turkish, ukenglish, ukrainian, uppersorbian, welsh, loaded.
+(/usr/local/texlive/2009/texmf-dist/tex/latex/memoir/memoir.cls
+Document Class: memoir 2009/02/06 v1.6180339e configurable book, report, articl
+e document class
+\onelineskip=\skip41
+\lxvchars=\skip42
+\xlvchars=\skip43
+\@memcnta=\count79
+\c@@memmarkcntra=\count80
+(/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/ifpdf.sty
+Package: ifpdf 2009/04/10 v2.0 Provides the ifpdf switch (HO)
+Package ifpdf Info: pdfTeX in pdf mode detected.
+)
+Class memoir Info: An `ifetex' package is being emulated on input line 247.
+
+(/usr/local/texlive/2009/../texmf-local/tex/generic/ifxetex/ifxetex.sty
+Package: ifxetex 2006/08/21 v0.3 Provides ifxetex conditional
+)
+(/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/ifluatex.sty
+Package: ifluatex 2009/04/10 v1.1 Provides the ifluatex switch (HO)
+Package ifluatex Info: LuaTeX not detected.
+)
+\stockheight=\skip44
+\stockwidth=\skip45
+\trimtop=\skip46
+\trimedge=\skip47
+
+(/usr/local/texlive/2009/texmf-dist/tex/latex/memoir/mem12.clo
+File: mem12.clo 2008/01/30 v0.4 memoir class 12pt size option
+)
+\binding=\skip48
+\spinemargin=\skip49
+\foremargin=\skip50
+\uppermargin=\skip51
+\lowermargin=\skip52
+\headdrop=\skip53
+\normalrulethickness=\skip54
+\headwidth=\skip55
+\c@storedpagenumber=\count81
+\memPD=\dimen102
+\m@mabparskip=\skip56
+\thanksmarkwidth=\skip57
+\thanksmarksep=\skip58
+\droptitle=\skip59
+\c@book=\count82
+\c@part=\count83
+\c@chapter=\count84
+\c@section=\count85
+\c@subsection=\count86
+\c@subsubsection=\count87
+\c@paragraph=\count88
+\c@subparagraph=\count89
+\beforechapskip=\skip60
+\midchapskip=\skip61
+\afterchapskip=\skip62
+\chapindent=\skip63
+\bottomsectionskip=\skip64
+\secindent=\skip65
+\beforesecskip=\skip66
+\aftersecskip=\skip67
+\subsecindent=\skip68
+\beforesubsecskip=\skip69
+\aftersubsecskip=\skip70
+\subsubsecindent=\skip71
+\beforesubsubsecskip=\skip72
+\aftersubsubsecskip=\skip73
+\paraindent=\skip74
+\beforeparaskip=\skip75
+\afterparaskip=\skip76
+\subparaindent=\skip77
+\beforesubparaskip=\skip78
+\aftersubparaskip=\skip79
+\pfbreakskip=\skip80
+\c@@ppsavesec=\count90
+\c@@ppsaveapp=\count91
+\ragrparindent=\dimen103
+\everylistparindent=\dimen104
+\parsepi=\skip81
+\topsepi=\skip82
+\itemsepi=\skip83
+\parsepii=\skip84
+\topsepii=\skip85
+\topsepiii=\skip86
+\itemsepii=\skip87
+\itemsepiii=\skip88
+\partopsepii=\skip89
+\partopsepiii=\skip90
+\m@msavetopsep=\skip91
+\m@msavepartopsep=\skip92
+\@enLab=\toks14
+\abstitleskip=\skip93
+\absleftindent=\skip94
+\abs@leftindent=\dimen105
+\absrightindent=\skip95
+\absparindent=\skip96
+\absparsep=\skip97
+\c@vslineno=\count92
+\c@poemline=\count93
+\c@modulo@vs=\count94
+\c@memfvsline=\count95
+\vleftskip=\skip98
+\vrightskip=\skip99
+\stanzaskip=\skip100
+\versewidth=\skip101
+\vgap=\skip102
+\vindent=\skip103
+\vleftmargin=\dimen106
+\c@verse=\count96
+\c@chrsinstr=\count97
+\beforepoemtitleskip=\skip104
+\afterpoemtitleskip=\skip105
+\c@poem=\count98
+\beforePoemTitleskip=\skip106
+\midPoemTitleskip=\skip107
+\afterPoemTitleskip=\skip108
+\col@sep=\dimen107
+\extrarowheight=\dimen108
+\NC@list=\toks15
+\extratabsurround=\skip109
+\backup@length=\skip110
+\TX@col@width=\dimen109
+\TX@old@table=\dimen110
+\TX@old@col=\dimen111
+\TX@target=\dimen112
+\TX@delta=\dimen113
+\TX@cols=\count99
+\TX@ftn=\toks16
+\heavyrulewidth=\dimen114
+\lightrulewidth=\dimen115
+\cmidrulewidth=\dimen116
+\belowrulesep=\dimen117
+\belowbottomsep=\dimen118
+\aboverulesep=\dimen119
+\abovetopsep=\dimen120
+\cmidrulesep=\dimen121
+\cmidrulekern=\dimen122
+\defaultaddspace=\dimen123
+\@cmidla=\count100
+\@cmidlb=\count101
+\@aboverulesep=\dimen124
+\@belowrulesep=\dimen125
+\@thisruleclass=\count102
+\@lastruleclass=\count103
+\@thisrulewidth=\dimen126
+\ctableftskip=\skip111
+\ctabrightskip=\skip112
+\abovecolumnspenalty=\count104
+\@linestogo=\count105
+\@cellstogo=\count106
+\@cellsincolumn=\count107
+\crtok=\toks17
+\@mincolumnwidth=\dimen127
+\c@newflo@tctr=\count108
+\@contcwidth=\skip113
+\@contindw=\skip114
+\abovecaptionskip=\skip115
+\belowcaptionskip=\skip116
+\subfloattopskip=\skip117
+\subfloatcapskip=\skip118
+\subfloatcaptopadj=\skip119
+\subfloatbottomskip=\skip120
+\subfloatlabelskip=\skip121
+\subfloatcapmargin=\dimen128
+\c@@contsubnum=\count109
+\m@mscap@capbox=\box26
+\m@mscap@fbox=\box27
+\sidecapsep=\dimen129
+\sidecapwidth=\dimen130
+\m@m@tempdima=\dimen131
+\m@mscapraise=\dimen132
+\sidecapraise=\dimen133
+\m@mscapmainwidth=\dimen134
+\m@mscaplkern=\dimen135
+\beforeepigraphskip=\skip122
+\afterepigraphskip=\skip123
+\epigraphwidth=\skip124
+\epigraphrule=\skip125
+LaTeX Info: Redefining \em on input line 6881.
+LaTeX Info: Redefining \emph on input line 6889.
+\tocentryskip=\skip126
+\tocbaseline=\skip127
+\cftparskip=\skip128
+\cftbeforebookskip=\skip129
+\cftbookindent=\dimen136
+\cftbooknumwidth=\dimen137
+\cftbeforepartskip=\skip130
+\cftpartindent=\skip131
+\cftpartnumwidth=\skip132
+\cftbeforechapterskip=\skip133
+\cftchapterindent=\skip134
+\cftchapternumwidth=\skip135
+\cftbeforesectionskip=\skip136
+\cftsectionindent=\skip137
+\cftsectionnumwidth=\skip138
+\cftbeforesubsectionskip=\skip139
+\cftsubsectionindent=\skip140
+\cftsubsectionnumwidth=\skip141
+\cftbeforesubsubsectionskip=\skip142
+\cftsubsubsectionindent=\skip143
+\cftsubsubsectionnumwidth=\skip144
+\cftbeforeparagraphskip=\skip145
+\cftparagraphindent=\skip146
+\cftparagraphnumwidth=\skip147
+\cftbeforesubparagraphskip=\skip148
+\cftsubparagraphindent=\skip149
+\cftsubparagraphnumwidth=\skip150
+\prechapterprecisshift=\dimen138
+\c@maxsecnumdepth=\count110
+\bibindent=\dimen139
+\bibitemsep=\skip151
+\indexcolsep=\skip152
+\indexrule=\skip153
+\indexmarkstyle=\toks18
+\@indexbox=\insert233
+\glossarycolsep=\dimen140
+\glossaryrule=\dimen141
+\sideparvshift=\skip154
+\sideins=\insert232
+\sidebartopsep=\skip155
+\sidebarhsep=\skip156
+\sidebarvsep=\skip157
+\sidebarwidth=\skip158
+\footmarkwidth=\skip159
+\footmarksep=\skip160
+\footparindent=\skip161
+\footinsdim=\skip162
+\footinsv@r=\insert231
+\@mpfootinsv@r=\insert230
+\m@m@k=\count111
+\m@m@h=\dimen142
+\m@mipn@skip=\skip163
+\c@pagenote=\count112
+\every@verbatim=\toks19
+\afterevery@verbatim=\toks20
+\verbatim@line=\toks21
+\tab@position=\count113
+\verbatim@in@stream=\read1
+\verbatimindent=\skip164
+\verbatim@out=\write3
+\bvboxsep=\skip165
+\c@memfbvline=\count114
+\c@bvlinectr=\count115
+\bvnumlength=\skip166
+\fb@frw=\dimen143
+\fb@frh=\dimen144
+\FrameRule=\dimen145
+\FrameSep=\dimen146
+\c@cp@cntr=\count116
+LaTeX Info: Redefining \: on input line 10718.
+LaTeX Info: Redefining \! on input line 10720.
+\c@ism@mctr=\count117
+\c@xsm@mctr=\count118
+\c@csm@mctr=\count119
+\c@ksm@mctr=\count120
+\c@xksm@mctr=\count121
+\c@cksm@mctr=\count122
+\c@msm@mctr=\count123
+\c@xmsm@mctr=\count124
+\c@cmsm@mctr=\count125
+\c@bsm@mctr=\count126
+\c@workm@mctr=\count127
+\c@sheetsequence=\count128
+\c@lastsheet=\count129
+\c@lastpage=\count130
+\c@figure=\count131
+\c@lofdepth=\count132
+\cftbeforefigureskip=\skip167
+\cftfigureindent=\skip168
+\cftfigurenumwidth=\skip169
+\c@table=\count133
+\c@lotdepth=\count134
+\cftbeforetableskip=\skip170
+\cfttableindent=\skip171
+\cfttablenumwidth=\skip172
+Package abstract [2008/07/23] emulated by memoir.
+Package appendix [2008/07/23] emulated by memoir.
+Package array [2008/07/23] emulated by memoir.
+Package booktabs [2008/07/23] emulated by memoir.
+Package ccaption [2008/07/23] emulated by memoir.
+Package changepage [2008/07/23] emulated by memoir.
+Package chngcntr [2008/07/23] emulated by memoir.
+Package chngpage [2008/07/23] emulated by memoir.
+Package crop emulated by memoir.
+Package dcolumn [2008/07/23] emulated by memoir.
+Package delarray [2008/07/23] emulated by memoir.
+Package enumerate [2008/07/23] emulated by memoir.
+Package epigraph [2008/07/23] emulated by memoir.
+Package ifmtarg [2008/07/23] emulated by memoir.
+Package ifetex [2008/07/23] emulated by memoir.
+Package index [2008/07/23] emulated by memoir.
+Package makeidx [2008/07/23] emulated by memoir.
+Package moreverb [2008/07/23] emulated by memoir.
+Package mparhack [2008/07/23] emulated by memoir.
+Package needspace [2008/07/23] emulated by memoir.
+Package newfile [2008/07/23] emulated by memoir.
+Package nextpage [2008/07/23] emulated by memoir.
+Package pagenote [2008/07/23] emulated by memoir.
+Package parskip [2008/07/23] emulated by memoir.
+Package patchcmd [2008/07/23] emulated by memoir.
+Package setspace [2008/07/23] emulated by memoir.
+Package shortvrb [2008/07/23] emulated by memoir.
+Package showidx [2008/07/23] emulated by memoir.
+Package tabularx [2008/07/23] emulated by memoir.
+Package titleref [2008/07/23] emulated by memoir.
+Package titling [2008/07/23] emulated by memoir.
+Package tocbibind [2008/07/23] emulated by memoir.
+Package tocloft [2008/07/23] emulated by memoir.
+Package verbatim [2008/07/23] emulated by memoir.
+Package verse [2008/07/23] emulated by memoir.
+
+(/usr/local/texlive/2009/texmf-dist/tex/latex/memoir/mempatch.sty
+File: mempatch.sty 2008/07/23 v6.0 Patches for memoir class v1.6180339
+))
+(/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/color.sty
+Package: color 2005/11/14 v1.0j Standard LaTeX Color (DPC)
+
+(/usr/local/texlive/2009/texmf/tex/latex/config/color.cfg
+File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
+)
+Package color Info: Driver file: pdftex.def on input line 130.
+
+(/usr/local/texlive/2009/texmf-dist/tex/latex/pdftex-def/pdftex.def
+File: pdftex.def 2008/09/08 v0.04l Graphics/color for pdfTeX
+\Gread@gobject=\count135
+))
+(/Users/will/Library/texmf/tex/latex/will/pstool.sty
+Package: pstool 2009/07/17 v1.3 Wrapper for processing PostScript/psfrag figure
+s
+
+(/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/catchfile.sty
+Package: catchfile 2007/11/11 v1.2 Catches the contents of a file (HO)
+
+(/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/infwarerr.sty
+Package: infwarerr 2007/09/09 v1.2 Providing info/warning/message (HO)
+))
+(/usr/local/texlive/2009/texmf-dist/tex/latex/ifplatform/ifplatform.sty
+Package: ifplatform 2007/11/18 v0.2 Testing for the operating system
+runsystem(echo 'write18-test-2009721653'>"example.w18")...executed.
+
+\instream=\read2
+runsystem(uname -s > "example.w18")...executed.
+
+\instream=\read3
+runsystem(rm -- "example.w18")...executed.
+
+)
+(/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/graphicx.sty
+Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
+
+(/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/keyval.sty
+Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
+\KV@toks@=\toks22
+)
+(/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/graphics.sty
+Package: graphics 2006/02/20 v1.0o Standard LaTeX Graphics (DPC,SPQR)
+
+(/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/trig.sty
+Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
+)
+(/usr/local/texlive/2009/texmf/tex/latex/config/graphics.cfg
+File: graphics.cfg 2009/07/06 v1.8 graphics configuration of TeX Live
+)
+Package graphics Info: Driver file: pdftex.def on input line 90.
+)
+(/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
+Package: pdftexcmds 2009/04/10 v0.4 LuaTeX support for pdfTeX utility functions
+ (HO)
+Package pdftexcmds Info: LuaTeX not detected on input line 145.
+)
+(/usr/local/texlive/2009/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
+Package: epstopdf-base 2009/07/12 v2.0 Base part for package epstopdf
+
+(/usr/local/texlive/2009/texmf-dist/tex/latex/oberdiek/grfext.sty
+Package: grfext 2007/09/30 v1.0 Managing graphics extensions (HO)
+)
+(/usr/local/texlive/2009/texmf-dist/tex/latex/oberdiek/kvoptions.sty
+Package: kvoptions 2009/04/10 v3.1 Keyval support for LaTeX options (HO)
+)
+Package grfext Info: Graphics extension search list:
+(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
+G,.JBIG2,.JB2,.eps]
+(grfext) \AppendGraphicsExtensions on input line 429.
+)
+\Gin@req@height=\dimen147
+\Gin@req@width=\dimen148
+)
+(/usr/local/texlive/2009/texmf-dist/tex/latex/psfrag/psfrag.sty
+Package: psfrag 1998/04/11 v3.04 PSfrag (MCG)
+\pfg@pcount=\count136
+\pfg@scount=\count137
+\pfg@temp=\write4
+)
+(/usr/local/texlive/2009/texmf-dist/tex/latex/bigfoot/suffix.sty
+Package: suffix 2006/07/15 1.5 Variant command support
+)
+(/usr/local/texlive/2009/texmf-dist/tex/latex/xkeyval/xkeyval.sty
+Package: xkeyval 2008/08/13 v2.6a package option processing (HA)
+
+(/usr/local/texlive/2009/texmf-dist/tex/generic/xkeyval/xkeyval.tex
+\XKV@toks=\toks23
+\XKV@tempa@toks=\toks24
+\XKV@depth=\count138
+File: xkeyval.tex 2008/08/13 v2.6a key=value parser (HA)
+))
+\pstool@out=\write5
+)
+(./macros.tex) (./example.aux)
+\openout1 = `example.aux'.
+
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7.
+LaTeX Font Info: ... okay on input line 7.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7.
+LaTeX Font Info: ... okay on input line 7.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7.
+LaTeX Font Info: ... okay on input line 7.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7.
+LaTeX Font Info: ... okay on input line 7.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7.
+LaTeX Font Info: ... okay on input line 7.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7.
+LaTeX Font Info: ... okay on input line 7.
+
+(/usr/local/texlive/2009/texmf-dist/tex/context/base/supp-pdf.tex
+[Loading MPS to PDF converter (version 2006.09.02).]
+\scratchcounter=\count139
+\scratchdimen=\dimen149
+\scratchbox=\box28
+\nofMPsegments=\count140
+\nofMParguments=\count141
+\everyMPshowfont=\toks25
+\MPscratchCnt=\count142
+\MPscratchDim=\dimen150
+\MPnumerator=\count143
+\everyMPtoPDFconversion=\toks26
+)
+runsystem(echo "
+
+=== pstool: begin processing ===")...executed.
+
+\openout5 = `./trial-pstool.tex'.
+
+runsystem(echo "
+=== pstool: auxiliary process: trial ===")...executed.
+
+runsystem(cd "./" ; latex -shell-escape -output-format=dvi -output-directory=".
+/" -interaction=nonstopmode "trial-pstool.tex" ; echo $? > pstool-statusfile.t
+xt)...executed.
+
+runsystem(touch ./pstool-statusfile.txt)...executed.
+
+ (./pstool-statusfile.txt)
+runsystem(cd "./"; rm -- "pstool-statusfile.txt" )...executed.
+
+runsystem(echo "
+=== pstool: dvips ===")...executed.
+
+runsystem(cd "./" ; dvips -Ppdf "trial-pstool.dvi" ; echo $? > pstool-statusfi
+le.txt)...executed.
+
+runsystem(touch ./pstool-statusfile.txt)...executed.
+
+ (./pstool-statusfile.txt)
+runsystem(cd "./"; rm -- "pstool-statusfile.txt" )...executed.
+
+runsystem(echo "
+=== pstool: ps2pdf ===")...executed.
+
+runsystem(cd "./" ; ps2pdf "-dAutoFilterColorImages=false" "-dAutoFilterGrayIma
+ges=false" "-dColorImageFilter=/FlateEncode" "-dGrayImageFilter=/FlateEncode" "
+-dPDFSETTINGS=/prepress" "trial-pstool.ps" "trial.pdf" ; echo $? > pstool-statu
+sfile.txt)...executed.
+
+runsystem(touch ./pstool-statusfile.txt)...executed.
+
+ (./pstool-statusfile.txt)
+runsystem(cd "./"; rm -- "pstool-statusfile.txt" )...executed.
+
+runsystem(cd "./"; rm -- "trial-pstool.tex" )...executed.
+
+runsystem(cd "./"; rm -- "trial-pstool.dvi" )...executed.
+
+runsystem(cd "./"; rm -- "trial-pstool.ps" )...executed.
+
+runsystem(cd "./"; rm -- "trial-pstool.log" )...executed.
+
+runsystem(cd "./"; rm -- "trial-pstool.aux" )...executed.
+
+<./trial.pdf, id=1, 196.735pt x 75.28125pt>
+File: ./trial.pdf Graphic file (type pdf)
+ <use ./trial.pdf>
+runsystem(echo "
+=== pstool: end processing ===
+")...executed.
+
+
+<subdir/trial2-psfrag.pdf, id=2, 139.52126pt x 149.55875pt>
+File: subdir/trial2-psfrag.pdf Graphic file (type pdf)
+
+<use subdir/trial2-psfrag.pdf> [1
+Non-PDF special ignored!{/usr/local/texlive/2009/texmf-var/fonts/map/pdftex/upd
+map/pdftex.map}
+
+ <./trial.pdf> <./subdir/trial2-psfrag.pdf>] (./example.aux) )
+Here is how much of TeX's memory you used:
+ 4536 strings out of 493857
+ 61323 string characters out of 1149727
+ 152097 words of memory out of 3000000
+ 7788 multiletter control sequences out of 15000+50000
+ 4590 words of font info for 17 fonts, out of 3000000 for 9000
+ 714 hyphenation exceptions out of 8191
+ 48i,11n,36p,432b,220s stack positions out of 5000i,500n,10000p,200000b,50000s
+</usr/local/texli
+ve/2009/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi6.pfb></usr/local/texlive
+/2009/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi8.pfb></usr/local/texlive/2
+009/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/local/texlive/200
+9/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb>
+Output written on example.pdf (1 page, 54480 bytes).
+PDF statistics:
+ 64 PDF objects out of 1000 (max. 8388607)
+ 0 named destinations out of 1000 (max. 131072)
+ 11 words of extra memory for PDF output out of 10000 (max. 10000000)
+
diff --git a/Master/texmf-dist/doc/latex/pstool/example.pdf b/Master/texmf-dist/doc/latex/pstool/example.pdf
index 235fea29758..5a7f09e5508 100644
--- a/Master/texmf-dist/doc/latex/pstool/example.pdf
+++ b/Master/texmf-dist/doc/latex/pstool/example.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pstool/example.synctex b/Master/texmf-dist/doc/latex/pstool/example.synctex
new file mode 100644
index 00000000000..2f4742a6555
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pstool/example.synctex
@@ -0,0 +1,204 @@
+SyncTeX Version:1
+Input:1:example.tex
+Input:2:/usr/local/texlive/2009/texmf-dist/tex/latex/memoir/memoir.cls
+Input:3:/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/ifpdf.sty
+Input:4:/usr/local/texlive/2009/../texmf-local/tex/generic/ifxetex/ifxetex.sty
+Input:5:/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/ifluatex.sty
+Input:6:/usr/local/texlive/2009/texmf-dist/tex/latex/memoir/mem12.clo
+Input:7:/usr/local/texlive/2009/texmf-dist/tex/latex/memoir/mempatch.sty
+Input:8:/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/color.sty
+Input:9:/usr/local/texlive/2009/texmf/tex/latex/config/color.cfg
+Input:10:/usr/local/texlive/2009/texmf-dist/tex/latex/pdftex-def/pdftex.def
+Input:11:/Users/will/Library/texmf/tex/latex/will/pstool.sty
+Input:12:/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/catchfile.sty
+Input:13:/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/infwarerr.sty
+Input:14:/usr/local/texlive/2009/texmf-dist/tex/latex/ifplatform/ifplatform.sty
+Input:15:/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/graphicx.sty
+Input:16:/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/keyval.sty
+Input:17:/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/graphics.sty
+Input:18:/usr/local/texlive/2009/texmf-dist/tex/latex/graphics/trig.sty
+Input:19:/usr/local/texlive/2009/texmf/tex/latex/config/graphics.cfg
+Input:20:/usr/local/texlive/2009/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
+Input:21:/usr/local/texlive/2009/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
+Input:22:/usr/local/texlive/2009/texmf-dist/tex/latex/oberdiek/grfext.sty
+Input:23:/usr/local/texlive/2009/texmf-dist/tex/latex/oberdiek/kvoptions.sty
+Input:24:/usr/local/texlive/2009/texmf-dist/tex/latex/psfrag/psfrag.sty
+Input:25:/usr/local/texlive/2009/texmf-dist/tex/latex/bigfoot/suffix.sty
+Input:26:/usr/local/texlive/2009/texmf-dist/tex/latex/xkeyval/xkeyval.sty
+Input:27:/usr/local/texlive/2009/texmf-dist/tex/generic/xkeyval/xkeyval.tex
+Input:28:macros.tex
+Input:29:example.aux
+Input:30:/usr/local/texlive/2009/texmf-dist/tex/context/base/supp-pdf.tex
+Input:31:./pstool-statusfile.txt
+Input:32:./pstool-statusfile.txt
+Input:33:./pstool-statusfile.txt
+Output:pdf
+Magnification:1000
+Unit:1
+X Offset:0
+Y Offset:0
+Content:
+!2250
+{1
+[1,21:4736286,32941263:17170432,28204977,285084
+[1,21:3818782,32941263:18087936,26828721,285084
+[1,21:3818782,7030046:18087936,917504,0
+(1,21:3818782,7062813:18087936,950271,0
+(1,21:3818782,7062813:18087936,950271,0
+g1,21:3818782,7062813
+(1,21:3818782,7062813:18087936,950271,0
+[1,21:3818782,7062813:18087936,950271,0
+(1,21:3818782,6777729:18087936,665187,285084
+(1,21:3818782,6777729:0,665187,285084
+[1,21:3818782,6777729:18087936,665187,285084
+(1,21:3818782,6777729:18087936,665187,285084
+h1,21:3818782,6777729:0,0,0
+r1,21:3818782,6777729:0,950271,285084
+k1,21:12862750,6777729:9043968
+k1,21:21906718,6777729:9043968
+)
+]
+k1,21:3818782,6777729:-18087936
+)
+g1,21:3818782,6777729
+[1,21:3818782,6777729:18087936,665187,285084
+(1,21:3818782,6777729:18087936,665187,285084
+k1,21:12862750,6777729:9043968
+h1,21:12862750,6777729:0,0,0
+r1,21:12862750,6777729:0,950271,285084
+g1,21:12862750,6777729
+k1,21:21906718,6777729:9043968
+)
+]
+g1,21:21906718,6777729
+(1,21:21906718,6777729:0,665187,285084
+k1,21:3818782,6777729:-18087936
+[1,21:3818782,6777729:18087936,665187,285084
+(1,21:3818782,6777729:18087936,665187,285084
+k1,21:21521698,6777729:17702916
+h1,21:21521698,6777729:0,0,0
+x1,21:21906718,6777729
+r1,21:21906718,6777729:0,950271,285084
+g1,21:21906718,6777729
+g1,21:21906718,6777729
+)
+]
+)
+)
+]
+)
+g1,21:21906718,7062813
+)
+)
+]
+[1,21:3818782,30975183:18087936,22642688,0
+[1,21:3818782,8332495:0,0,0
+(1,21:3818782,8332495:0,0,0
+g1,21:21906718,8332495
+g1,21:22365470,8332495
+k1,21:3818782,8332495:-18546688
+)
+]
+(1,10:3818782,9118927:18087936,546132,152916
+h1,9:3818782,9118927:1155060,0,0
+x1,9:7872051,9118927
+g1,9:8128731,9118927
+x1,9:10699809,9118927
+g1,9:11042049,9118927
+x1,9:11833206,9118927
+g1,9:12089886,9118927
+x1,9:12849095,9118927
+g1,9:13105775,9118927
+x1,9:13661915,9118927
+k1,10:21906718,9118927:8244803
+g1,10:21906718,9118927
+)
+(1,16:3818782,14270998:18087936,4933619,0
+h1,15:3818782,14270998:1155060,0,0
+(1,15:4973842,14270998:12893192,4933619,0
+(1,15:4973842,14270998:12893225,4933632,0
+(1,15:4973842,14270998:12893225,4933632,0
+(1,15:4973842,14270998:0,4933632,0
+(1,15:4973842,14270998:12893225,4933632,0
+)
+k1,15:4973842,14270998:-12893225
+)
+)
+)
+)
+k1,16:21906718,14270998:4039684
+g1,16:21906718,14270998
+)
+(1,20:3818782,24137992:18087936,9801458,0
+h1,19:3818782,24137992:1155060,0,0
+(1,19:4973842,24137992:9143642,9801458,0
+(1,19:4973842,24137992:9143665,9801482,0
+(1,19:4973842,24137992:9143665,9801482,0
+(1,19:4973842,24137992:0,9801482,0
+(1,19:4973842,24137992:9143665,9801482,0
+)
+k1,19:4973842,24137992:-9143665
+)
+)
+)
+)
+k1,20:21906718,24137992:7789234
+g1,20:21906718,24137992
+)
+]
+(1,21:3818782,32941263:18087936,665187,285084
+(1,21:3818782,32941263:18087936,665187,285084
+g1,21:3818782,32941263
+(1,21:3818782,32941263:18087936,665187,285084
+[1,21:3818782,32941263:18087936,665187,285084
+(1,21:3818782,32941263:18087936,665187,285084
+(1,21:3818782,32941263:0,665187,285084
+[1,21:3818782,32941263:18087936,665187,285084
+(1,21:3818782,32941263:18087936,665187,285084
+h1,21:3818782,32941263:0,0,0
+r1,21:3818782,32941263:0,950271,285084
+k1,21:12862750,32941263:9043968
+k1,21:21906718,32941263:9043968
+)
+]
+k1,21:3818782,32941263:-18087936
+)
+g1,21:3818782,32941263
+[1,21:3818782,32941263:18087936,665187,285084
+(1,21:3818782,32941263:18087936,665187,285084
+k1,21:12862750,32941263:9043968
+h1,21:12862750,32941263:0,0,0
+r1,21:12862750,32941263:0,950271,285084
+g1,21:12862750,32941263
+k1,21:21906718,32941263:9043968
+)
+]
+g1,21:21906718,32941263
+(1,21:21906718,32941263:0,665187,285084
+k1,21:3818782,32941263:-18087936
+[1,21:3818782,32941263:18087936,665187,285084
+(1,21:3818782,32941263:18087936,665187,285084
+k1,21:21906718,32941263:18087936
+h1,21:21906718,32941263:0,0,0
+r1,21:21906718,32941263:0,950271,285084
+g1,21:21906718,32941263
+g1,21:21906718,32941263
+)
+]
+)
+)
+]
+)
+g1,21:21906718,32941263
+)
+)
+]
+]
+!3815
+}1
+Input:34:example.aux
+!30
+Postamble:
+Count:140
+!25
+Post scriptum:
diff --git a/Master/texmf-dist/doc/latex/pstool/example.tex b/Master/texmf-dist/doc/latex/pstool/example.tex
index b075b6deccb..03ac5836acc 100644
--- a/Master/texmf-dist/doc/latex/pstool/example.tex
+++ b/Master/texmf-dist/doc/latex/pstool/example.tex
@@ -8,7 +8,7 @@
External macros: \a, \b, \c
-\psfragfig{trial}{%
+\psfragfig*[mode=nonstop]{trial}{%
\color{red}
\tiny
\psfrag{[Mp]}{$M_\a$!}%
diff --git a/Master/texmf-dist/doc/latex/pstool/pstool.pdf b/Master/texmf-dist/doc/latex/pstool/pstool.pdf
index a15685d8b81..85c9fdf322e 100644
--- a/Master/texmf-dist/doc/latex/pstool/pstool.pdf
+++ b/Master/texmf-dist/doc/latex/pstool/pstool.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pstool/subdir/trial2-psfrag.pdf b/Master/texmf-dist/doc/latex/pstool/subdir/trial2-psfrag.pdf
new file mode 100644
index 00000000000..d79323bab3b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pstool/subdir/trial2-psfrag.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/pstool/trial.pdf b/Master/texmf-dist/doc/latex/pstool/trial.pdf
new file mode 100644
index 00000000000..2ff0f952637
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pstool/trial.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/pstool/pstool.ins b/Master/texmf-dist/source/latex/pstool/pstool.ins
index db826218d17..7177afc608e 100644
--- a/Master/texmf-dist/source/latex/pstool/pstool.ins
+++ b/Master/texmf-dist/source/latex/pstool/pstool.ins
@@ -1,4 +1,4 @@
%&latex
\def\pstoolCompile{N}
\input pstool.tex
-\csname@@end\endcsname
+\csname @@end\endcsname
diff --git a/Master/texmf-dist/source/latex/pstool/pstool.tex b/Master/texmf-dist/source/latex/pstool/pstool.tex
index d4b434b399f..cf7901521ef 100644
--- a/Master/texmf-dist/source/latex/pstool/pstool.tex
+++ b/Master/texmf-dist/source/latex/pstool/pstool.tex
@@ -2,34 +2,44 @@
\begin{filecontents*}{README.txt}
__________________
The pstool package
-v1.2b
+v1.3
-A package like "pst-pdf" for processing PostScript graphics
-with psfrag labels within pdfLaTeX documets. The difference
-with this package is that every graphic is compiled individually,
+A package like "pst-pdf" for processing PostScript graphics
+with psfrag labels within pdfLaTeX documets. The difference
+with this package is that every graphic is compiled individually,
drastically speeding up compilation time when only a single
figure needs re-processing.
Running `latex` on pstool.tex will produce the files
pstool.ins, pstool.sty, and README.txt,
-and compile the PDF documentation.
+and compile the PDF documentation.
-Executing `tex pstool.ins` produces the files above
+Executing `latex pstool.ins` produces the files above
except pstool.ins (and the PDF file, obviously).
+Please see the PDF documentation for further information.
+
Will Robertson & Zebb Prime
-Copyright 2008
+Copyright 2008-2009
+
+____________________
+Brief change history
+
+v1.3, July 2009:
+ - [bitmap] option to control compression of bitmap graphics,
+ - Package options may now be set anywhere with \pstoolsetup{},
+ - localised pstool options can be set per-graphic.
+
\end{filecontents*}
\begin{filecontents}{pstool.sty}
-\ProvidesPackage{pstool}[2009/07/03 v1.2b
+\ProvidesPackage{pstool}[2009/07/17 v1.3
Wrapper for processing PostScript/psfrag figures]
% External packages
\RequirePackage{%
catchfile,color,ifpdf,ifplatform,
- graphicx,psfrag,suffix,xkeyval}
-\RequirePackage{inversepath}[2008/07/31 v0.2]
+ graphicx,pdftexcmds,psfrag,suffix,xkeyval}
% Allocations
\newif\if@pstool@pdfcrop@
@@ -57,13 +67,13 @@ Copyright 2008
\ExecuteOptionsX{process=auto}
\define@choicekey*{pstool.sty}{mode}
- [\@tempa\@tempb]{errorstop,nonstop,batch}{%
- \ifnum\@tempb=2\relax
- \@pstool@verbose@false
- \else
- \@pstool@verbose@true
- \fi
- \edef\pstool@mode{\@tempa mode}%
+ [\@tempa\@tempb]{errorstop,nonstop,batch}{%
+ \ifnum\@tempb=2\relax
+ \@pstool@verbose@false
+ \else
+ \@pstool@verbose@true
+ \fi
+ \edef\pstool@mode{\@tempa mode}%
}
\ExecuteOptionsX{mode=batch}
@@ -73,6 +83,29 @@ Copyright 2008
\DeclareOptionX{suffix}{\def\pstool@suffix{#1}}
\ExecuteOptionsX{suffix={-pstool}}
+% There is an implicit |\space| after the bitmap options.
+\define@choicekey*{pstool.sty}{bitmap}
+ [\@tempa\@tempb]{auto,lossless,lossy}{%
+ \ifcase\@tempb
+ \let\pstool@bitmap@opts\@empty
+ \or
+ \def\pstool@bitmap@opts{%
+ "-dAutoFilterColorImages=false"
+ "-dAutoFilterGrayImages=false"
+ "-dColorImageFilter=/FlateEncode"
+ "-dGrayImageFilter=/FlateEncode" % space
+ }
+ \or
+ \def\pstool@bitmap@opts{%
+ "-dAutoFilterColorImages=false"
+ "-dAutoFilterGrayImages=false"
+ "-dColorImageFilter=/DCTEncode"
+ "-dGrayImageFilter=/DCTEncode" % space
+ }
+ \fi
+}
+\ExecuteOptionsX{bitmap=lossless}
+
% \HideAllDefining
% \Define*{latex-options}
% \Define*{dvips-options}
@@ -83,11 +116,12 @@ Copyright 2008
\DeclareOptionX{ps2pdf-options}{\def\pstool@pspdf@opts{#1}}
\DeclareOptionX{pdfcrop-options}{\def\pstool@pdfcrop@opts{#1}}
% \ResumeAllDefining
-\ExecuteOptionsX{%
+\ExecuteOptionsX{
latex-options={},
dvips-options={},
- ps2pdf-options={},
- pdfcrop-options={}}
+ ps2pdf-options={"-dPDFSETTINGS=/prepress"},
+ pdfcrop-options={}
+}
\ifpdf
\ifshellescape\else
@@ -101,6 +135,11 @@ Copyright 2008
\ProcessOptionsX
+% A command to set \pkg{pstool} options after the package is loaded.
+\newcommand\pstoolsetup{%
+ \setkeys{pstool.sty}%
+}
+
% \section{Macros}
% Used to echo information to the console output.
@@ -109,7 +148,8 @@ Copyright 2008
\def\pstool@echo#1{%
\if@pstool@verbose@
\pstool@echo@verbose{#1}%
- \fi}
+ \fi
+}
\def\pstool@echo@verbose#1{%
\immediate\write18{echo "#1"}%
@@ -127,7 +167,9 @@ Copyright 2008
\newcommand\pstool@rm[2]{%
\OnlyIfFileExists{#1#2}{%
\immediate\write18{%
- cd "#1"\pstool@cmdsep\pstool@rm@cmd "#2"}}%
+ cd "#1"\pstool@cmdsep\pstool@rm@cmd "#2"
+ }%
+ }%
}
% Generic function to execute a command on the shell and pass its exit status back into \LaTeX. Any number of \cmd\pstool@exe\ statements can be made consecutively followed by \cmd\pstool@endprocess, which also takes an argument. If \emph{any} of the shell calls failed, then the execution immediately skips to the end and expands \cmd\pstool@error\ instead of the argument to \cmd\pstool@endprocess.
@@ -142,14 +184,19 @@ Copyright 2008
\ifnum\pstool@status > \z@
\PackageWarning{pstool}{Execution failed during process:^^J\space\space#3^^JThis warning occurred}%
\expandafter\pstool@abort
- \fi}
+ \fi
+}
% Edit this definition to print something else when graphic processing fails.
\def\pstool@error{%
\fbox{%
\parbox{0.8\linewidth}{%
\color{red}\raggedright\ttfamily\scshape\small
- An error occured processing graphic \upshape`\ip@directpath\ip@lastelement'}}}
+ An error occured processing graphic
+ \upshape`\pstool@path\pstool@filestub'%
+ }%
+ }%
+}
\def\pstool@abort#1\pstool@endprocess{\pstool@error\@gobble}
\let\pstool@endprocess\@firstofone
@@ -170,7 +217,8 @@ Copyright 2008
\ifwindows\else
\immediate\write18{%
touch #1\pstool@statusfile}%
- \fi}
+ \fi
+}
\def\pstool@statusfile{pstool-statusfile.txt}
% Read the exit status from the temporary file and delete it.\\
@@ -184,62 +232,52 @@ Copyright 2008
Status of process unable to be determined:^^J #1^^J%
Trying to proceed... }%
\def\pstool@status{0}%
- \fi}
+ \fi
+}
\def\pstool@statusfail{\par }% what results when \TeX\ reads an empty file
% \subsection{File age detection}
-% Use |ls| (or |dir|) to detect if the EPS is newer than the PDF.
\def\pstool@IfnewerEPS{%
- \edef\pstool@filenames{\ip@lastelement.eps\space \ip@lastelement.pdf\space}%
- \immediate\write18{%
- cd "\ip@directpath"\pstool@cmdsep
- \ifwindows
- dir /T:W /B /O-D "\ip@lastelement.eps" "\ip@lastelement.pdf" > \pstool@statusfile
- \else
- ls -t "\ip@lastelement.eps" "\ip@lastelement.pdf" > \pstool@statusfile
- \fi
- }%
- \pstool@retrievestatus{\ip@directpath}%
- \ifx\pstool@status\pstool@filenames
+ \ifnum\pdf@strcmp{\pdf@filemoddate{\pstool@path\pstool@filestub.pdf}}
+ {\pdf@filemoddate{\pstool@path\pstool@filestub.eps}}
+ < \z@
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}
-% A wrapper for \cs{inversepath*}. Long story short, always need a relative path to a filename even if it's in the same directory.
+% Grab filename and filepath. Always need a relative path to a filename even if it's in the same directory.
\def\pstool@getpaths#1{%
- \edef\@tempa{\unexpanded{\inversepath*}{#1}}%
- \@tempa% calculate filename, path \& inverse path
- \ifx\ip@directpath\@empty
- \def\ip@directpath{./}%
+ \filename@parse{#1}%
+ \ifx\filename@area\@empty
+ \def\pstool@path{./}%
+ \else
+ \let\pstool@path\filename@area
\fi
-% Strip off a possible wayward |.eps| suffix.
- \edef\ip@lastelement{%
- \expandafter\pstool@stripEPS\ip@lastelement.eps\@nil
- }%
+ \let\pstool@filestub\filename@base
}
-\def\pstool@stripEPS#1.eps#2\@nil{#1}
-% |test.eps\@nil| $\to$ |test| (|#2| $\to$ \<empty>)\\
-% |test.eps.eps\@nil| $\to$ |test| (|#2| $\to$ |.eps|)
-
% \section{Command parsing}
% User input is \cmd\pstool\ (with optional |*| or |!| suffix) which turns into one of the following three macros depending on the mode.
\newcommand\pstool@alwaysprocess[3][]{%
\pstool@getpaths{#2}%
- \pstool@process{#1}{#3}}
+ \pstool@process{#1}{#3}%
+}
\ifpdf
\newcommand\pstool@neverprocess[3][]{%
- \pstool@includegraphics{#2}}
+ \pstool@includegraphics{#2}%
+ }
\else
\newcommand\pstool@neverprocess[3][]{%
\begingroup
+ \setkeys*{pstool.sty}{#1}%
#3%
- \pstool@includegraphics[#1]{#2}%
- \endgroup}
+ \expandafter\pstool@includegraphics\expandafter[\XKV@rm]{#2}%
+ \endgroup
+ }
\fi
% For regular operation, which processes the figure only if
@@ -254,24 +292,33 @@ Copyright 2008
}%
}{%
\pstool@process{#1}{#3}%
- }}
+ }%
+}
% \section{User commands}
% Finally, define \cmd\pstool\ as appropriate for the mode: (|all|, |none|, |auto|, respectively)
\ifpdf
- \ifcase\pstool@process@choice
- \let\pstool\pstool@alwaysprocess
- \WithSuffix\def\pstool!{\pstool@alwaysprocess}
- \WithSuffix\def\pstool*{\pstool@alwaysprocess}
- \or
- \let\pstool\pstool@neverprocess
- \WithSuffix\def\pstool!{\pstool@neverprocess}
- \WithSuffix\def\pstool*{\pstool@neverprocess}
- \or
- \let\pstool\pstool@maybeprocess
- \WithSuffix\def\pstool!{\pstool@neverprocess}
- \WithSuffix\def\pstool*{\pstool@alwaysprocess}
- \fi
+ \newcommand\pstool{%
+ \ifcase\pstool@process@choice\relax
+ \expandafter \pstool@alwaysprocess \or
+ \expandafter \pstool@neverprocess \or
+ \expandafter \pstool@maybeprocess
+ \fi
+ }
+ \WithSuffix\def\pstool!{%
+ \ifcase\pstool@process@choice\relax
+ \expandafter \pstool@alwaysprocess \or
+ \expandafter \pstool@neverprocess \or
+ \expandafter \pstool@neverprocess
+ \fi
+ }
+ \WithSuffix\def\pstool*{%
+ \ifcase\pstool@process@choice\relax
+ \expandafter \pstool@alwaysprocess \or
+ \expandafter \pstool@neverprocess \or
+ \expandafter \pstool@alwaysprocess
+ \fi
+ }
\else
\let\pstool\pstool@neverprocess
\WithSuffix\def\pstool!{\pstool@neverprocess}
@@ -280,88 +327,97 @@ Copyright 2008
% \section{The figure processing}
-% \cmd\ip@lastelement\ is the filename of the figure stripped of its path (if any)
-\def\pstool@jobname{\ip@lastelement\pstool@suffix}
+% \cmd\pstool@filestub\ is the filename of the figure stripped of its path (if any)
+\def\pstool@jobname{\pstool@filestub\pstool@suffix}
% And this is the main macro.
\newcommand\pstool@process[2]{%
+ \begingroup
+ \setkeys*{pstool.sty}{#1}%
\pstool@echo@verbose{%
^^J^^J=== pstool: begin processing ===}%
\pstool@write@processfile{#1}
- {\ip@directpath\ip@lastelement}{#2}%
- \pstool@exe{auxiliary process: \ip@lastelement\space}
+ {\pstool@path\pstool@filestub}{#2}%
+ \pstool@exe{auxiliary process: \pstool@filestub\space}
{./}{latex
-shell-escape
-output-format=dvi
- -output-directory="\ip@directpath"
+ -output-directory="\pstool@path"
-interaction=\pstool@mode\space
\pstool@latex@opts\space
"\pstool@jobname.tex"}%
% Execute |dvips| in quiet mode if |latex| is not run in (non/error)stop mode:
- \pstool@exe{dvips}{\ip@directpath}{%
+ \pstool@exe{dvips}{\pstool@path}{%
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@exe{ps2pdf}{\pstool@path}{%
+ ps2pdf \pstool@bitmap@opts \pstool@pspdf@opts \space
"\pstool@jobname.ps" "\pstool@jobname.pdf"}%
- \pstool@exe{pdfcrop}{\ip@directpath}{%
+ \pstool@exe{pdfcrop}{\pstool@path}{%
pdfcrop \pstool@pdfcrop@opts\space
- "\pstool@jobname.pdf" "\ip@lastelement.pdf"}%
+ "\pstool@jobname.pdf" "\pstool@filestub.pdf"}%
\else
- \pstool@exe{ps2pdf}{\ip@directpath}{%
- ps2pdf \pstool@pspdf@opts\space
- "\pstool@jobname.ps" "\ip@lastelement.pdf"}%
+ \pstool@exe{ps2pdf}{\pstool@path}{%
+ ps2pdf \pstool@bitmap@opts \pstool@pspdf@opts \space
+ "\pstool@jobname.ps" "\pstool@filestub.pdf"}%
\fi
\pstool@endprocess{%
\pstool@cleanup
\pstool@includegraphics{%
- \ip@directpath\ip@lastelement}%
+ \pstool@path\pstool@filestub}%
}%
\pstool@echo@verbose{^^J=== pstool: end processing ===^^J}%
+ \endgroup
}
% 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
- \immediate\write\pstool@out{%
+ \immediate\openout\pstool@out #2\pstool@suffix.tex\relax
+ \immediate\write\pstool@out{%
% 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}%
- \noexpand\input{\jobname}^^J%
+ \unexpanded{%
+ \pdfoutput=0^^J% force DVI mode if not already
+ \let\origdocument\document^^J%
+ \let\EndPreamble\endinput^^J%
+ \def\document{\endgroup\endinput}^^J%
+ }%
+ \noexpand\input{\jobname}^^J%
%
% Now the preamble of the process file: (restoring document's original meaning; empty \cmd\pagestyle\ removes the page number)
- \if@pstool@pdfcrop@\else
- \noexpand\usepackage[active,tightpage]{preview}^^J%
- \fi
- \unexpanded{%
- \let\document\origdocument^^J%
- \pagestyle{empty}^^J}%
+ \if@pstool@pdfcrop@\else
+ \noexpand\usepackage[active,tightpage]{preview}^^J%
+ \fi
+ \unexpanded{%
+ \let\document\origdocument^^J%
+ \pagestyle{empty}^^J%
+ }%
%
% And the document body to place the graphic on a page of its own:
- \unexpanded{%
- \begin{document}^^J%
- \centering\null\vfill^^J}%
- \if@pstool@pdfcrop@\else
- \noexpand\begin{preview}^^J%
- \fi
- \unexpanded{#3^^J}% this is the "psfrag" material
- \noexpand\includegraphics[#1]{\ip@lastelement}^^J%
- \if@pstool@pdfcrop@\else
- \noexpand\end{preview}^^J%
- \fi
- \unexpanded{%
- \vfill\end{document}}^^J%
- }%
- \immediate\closeout\pstool@out}
+ \unexpanded{%
+ \begin{document}^^J%
+ \centering\null\vfill^^J%
+ }%
+ \if@pstool@pdfcrop@\else
+ \noexpand\begin{preview}^^J%
+ \fi
+ \unexpanded{#3^^J}% this is the "psfrag" material
+ \noexpand\includegraphics
+ [\unexpanded\expandafter{\XKV@rm}]
+ {\pstool@filestub}^^J%
+ \if@pstool@pdfcrop@\else
+ \noexpand\end{preview}^^J%
+ \fi
+ \unexpanded{\vfill\end{document}}^^J%
+ }%
+ \immediate\closeout\pstool@out
+}
\def\pstool@cleanup{%
\@for\@ii:=\pstool@rm@files\do{%
- \pstool@rm{\ip@directpath}{\pstool@jobname\@ii}%
-}}
+ \pstool@rm{\pstool@path}{\pstool@jobname\@ii}%
+ }%
+}
\providecommand\EndPreamble{}
@@ -466,7 +522,7 @@ Copyright 2008
%&latex
\def\pstoolCompile{N}
\input pstool.tex
-\csname@@end\endcsname
+\csname @@end\endcsname
\end{filecontents*}
@@ -550,13 +606,24 @@ More flexible usage to provide a complete replacement for \pkg{pst-pdf} (e.g., s
\section{Getting started}
-Load the package as usual; no package options are required by default, but there are a few useful options described later in section~\ref{pkgopt}. Note that you do not need to load \pkg{psfrag} separately. You also do not need to load \pkg{graphicx} separately, but if you do so, ensure that you do \emph{not} include driver information (such as |[pdftex]|); this will play havoc with \pkg{pstool}'s automatic processing stage.
+Processing pdf\/\LaTeX\ documents with \pkg{pstool} requires the `shell escape' feature of pdf\/\TeX\ to be activated.
+This allows execution of auxiliary commands from within \LaTeX, a feature which is often disabled by default for security reasons.
+If shell escape is not enabled, a warning will be issued in console output when the package is loaded.
+Depending how you compile your \LaTeX\ document, shell escape is enabled in different ways.%
+\footnote{On the command line, use the \texttt{-shell-escape} switch. Otherwise, you're on your own.}
+
+Load the package as usual; no package options are required by default, but there are a few useful options described later in section~\ref{pkgopt}.
+Note that you do not need to load \pkg{psfrag} separately.
+You also do not need to load \pkg{graphicx} separately, but if you do so, ensure that you do \emph{not} include driver information (such as |[pdftex]|); this will play havoc with \pkg{pstool}'s automatic processing stage.
The generic command provided by this package is\par
{\centering
- \cmd\pstool\ \arg[graphicx options] \arg{filename} \arg{input definitions}
+ \cmd\pstool\ \arg[options] \arg{filename} \arg{input definitions}
\par}
-It converts the graphic \<filename>|.eps| to \<filename>|.pdf| through a unique \DVI$\to$\PS$\to$\PDF\ process for each graphic, using the preamble of the main document. The resulting graphic is then inserted into the document, with optional \<graphicx options>. Note that these optional arguments take effect in the \emph{processing stage}; if you change the \<options>, you must re-process the figure. The third argument to \cmd\pstool\ allows arbitrary \<input definitions> (such as \cmd\psfrag\ directives) to be inserted before the figure as it is processed.
+It converts the graphic \<filename>|.eps| to \<filename>|.pdf| through a unique \DVI$\to$\PS$\to$\PDF\ process for each graphic, using the preamble of the main document.
+The resulting graphic is then inserted into the document, with \<options> consisting of options for \pkg{graphicx} (e.g., \texttt{angle}, \texttt{scale}) or for \pkg{pstool} (as described later in Section~\ref{pkgopt}).
+Note that these optional arguments take effect in the \emph{processing stage}; if you change the \<options>, you must manually re-process the figure.
+The third argument to \cmd\pstool\ allows arbitrary \<input definitions> (such as \cmd\psfrag\ directives) to be inserted before the figure as it is processed.
The command \cmd\pstool\ can take an optional |*| or |!| suffix to change the behaviour of the command:
\begin{description}
@@ -580,12 +647,15 @@ As above, but inserts the arbitrary code \<input definitions>, which will usuall
\section{Package options}
\label{pkgopt}
+Package options can be set or overridden at any time with \cmd\pstoolsetup\marg{pstool settings}.
+As mentioned in the previous section, these options also may be set in the optional argument to \cmd\pstool\ and \cmd\psfragfig, in which case they apply to that figure alone.
+
\subsection{Forcing/disabling graphics processing}
\label{process}
-While the suffixes |*| and |!| can be used to force or disable (respectively) the processing of each individual graphic, sometimes we want to do this on a global level. The following package options override \emph{all} \pkg{pstool} macros:
+While the suffixes |*| and |!| can be used to force or disable (respectively) the processing of each individual graphic, sometimes we want to do this on a global level. The following package options override \emph{all} \pkg{pstool} macros:
\begin{description}
-\item[\pkgopt{process=auto}] This is the default mode as described in the previous section, in which graphics with suffixes are only (re-)processed if the \EPS\ file is newer or the \PDF\ file does not exist;
+\item[\pkgopt{process=auto}] This is the default mode as described in the previous section, in which graphics without suffixes are only (re-)processed if the \EPS\ file is newer or the \PDF\ file does not exist;
\item[\pkgopt{process=all}] Suffixes are ignored and all \cmd\pstool\ graphics are processed;
\item[\pkgopt{process=none}] Suffixes are ignored and no \cmd\pstool\ graphics are processed.\footnote{If \pkg{pstool} is loaded in a \LaTeX\ document in \DVI\ mode, this is the option that is used since no external processing is required for these graphics.}
\end{description}
@@ -615,22 +685,32 @@ These three package options correspond to the \LaTeX\ command line options \text
\subsection{Auxiliary processing command line options}
The command line options passed to each program of the auxiliary processing can be changed with the following package options:
\begin{description}
-\item[\pkgopt{latex-options=...}];
-\item[\pkgopt{dvips-options=...}];
-\item[\pkgopt{ps2pdf-options=...}]; and,
-\item[\pkgopt{pdfcrop-options=...}].
+\item[\pkgopt{latex-options=...}]
+\item[\pkgopt{dvips-options=...}]
+\item[\pkgopt{ps2pdf-options=...}] and,
+\item[\pkgopt{pdfcrop-options=...}] (if applicable).
+\end{description}
+For the most part these will be unnecessary, although passing the correct options to |ps2pdf| can sometimes be a little obscure.\footnote{The manual is here: \url{http://pages.cs.wisc.edu/~ghost/doc/cvs/Ps2pdf.htm}} For example, I use the following for generating figures in my thesis:%
+\footnote{Note that each \texttt{ps2pdf} option must be quoted in Windows, which is unnecessary but does no harm in Linux and Mac~OS~X.}%
+\par{\centering|ps2pdf-options={"-dPDFSETTINGS=/prepress"}|\par}
+This forces the `base fourteen' fonts to be embedded within the individual figure files, without which some printers and \textsc{pdf} viewers have trouble with the textual labels. In fact, from v1.3 of \pkg{pstool}, this option is now the default.
+Note that subsequent calls to \pkgopt{ps2pdf-options=...} will override the \pkg{pstool} default; use |ps2pdf-options={}| to chose |ps2pdf|'s defaults if necessary.
+
+\subsection{Compression of bitmap data}
+In the conversion using |ps2pdf|, bitmap images are stored using either lossy or lossless compression. The default behaviour for \pkg{pstool} is to force lossless compression, because we believe that to be the most commonly desired use case (you don't want scientific graphics rendered with possible compression artifacts). This behaviour can be adjusted using one of these options:
+\begin{description}
+\item[\pkgopt{bitmap=auto}] do whatever |ps2pdf| does by default, which seems to be to use lossy compression most, if not all, of the time;
+\item[\pkgopt{bitmap=lossy}] bitmap images are compressed like \textsc{jpg}; this is only really suitable for photographs;
+\item[\pkgopt{bitmap=lossless}] bitmap images are compressed like \textsc{png}; this is suitable for screenshots and generated data such as a surface plot within Matlab (\emph{default}).
\end{description}
-For the most part these will be unnecessary, although passing the correct options to |ps2pdf| can sometimes be a little obscure. For example, I use the following for generating figures in my thesis:\par
-{\centering|ps2pdf-options={-dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress}|\par}
-I believe this incantation forces fonts to be embedded within the individual figure files, without which some printers and \textsc{pdf} viewers have trouble with the textual labels.
+These are just special cases of the \pkgopt{ps2pdf-options=...} option, but using \pkgopt{bitmap=...} is much more convenient since the |ps2pdf| options to effect this behaviour are quite verbose.
+Note that the |auto| and |lossy| outputs differ in quality; |lossy| is lower quality than |auto| even when the latter uses a lossy compression scheme. Adjusting the quality for these options is only possible with relatively complex Ghostscript options.
\section{Miscellaneous details}
\subsection{The \cmd\EndPreamble\ command}
-At present, \pkg{pstool} scans the preamble of the main document by redefining |\begin{document}|, but this is rather fragile because many classes and packages do their own redefining which overwrites \pkg{pstool}'s attempt. In this case, place the command\par
-{\centering|\EndPreamble|\par}\noindent
-where-ever you'd like the preamble in the auxiliary processing to end (although is must be placed before |\begin{document}| for obvious reasons). This is also handy to bypass anything in the preamble that will never be required for the figures but which will slow down or otherwise conflict with the auxiliary processing.
+At present, \pkg{pstool} scans the preamble of the main document by redefining |\begin{document}|, but this is rather fragile because many classes and packages do their own redefining which overwrites \pkg{pstool}'s attempt. In this case, place the command \cmd\EndPreamble\ where-ever you'd like the preamble in the auxiliary processing to end (although is must be placed before |\begin{document}| for obvious reasons). This is also handy to bypass anything in the preamble that will never be required for the figures but which will slow down or otherwise conflict with the auxiliary processing.
\subsection{Cross-reference limitations}
@@ -638,9 +718,9 @@ The initial release of this package does not support cross-references within the
\subsection{A note on file paths}
-\pkg{pstool} does its best to ensure that you can put image files where-ever you like and the auxiliary processing will still function correctly. In order to ensure this, the external |pdflatex| compilation uses the |-output-directory| feature of \pdfTeX. This command line option is definitely supported on all platforms in TeX~Live~2008 and MiKTeX~2.7, but earlier distributions may not be supported.
+\pkg{pstool} tries to ensure that you can put image files in subdirectories of the main document and the auxiliary processing will still function correctly. In order to ensure this, the external |pdflatex| compilation uses the |-output-directory| feature of \pdfTeX. This command line option is definitely supported on all platforms from TeX~Live~2008 and MiKTeX~2.7 onwards, but earlier distributions may not be supported.
-One problem that \pkg{pstool} does not (currently) solve on its own is the inclusion of images that do not exist in subdirectories of the main document. For example, |\pstool{../Figures/myfig}| will not process by default because \pdfTeX\ usually does not have permission to write into folders that are higher in the heirarchy than the main document. This can be worked around presently in two different ways: (although maybe only for Mac~OS~X and Linux)
+One problem that \pkg{pstool} does not solve on its own is the inclusion of images that do not exist in subdirectories of the main document. For example, |\pstool{../Figures/myfig}| can not process by default because \pdfTeX\ usually does not have permission to write into folders that are higher in the heirarchy than the main document. This can be worked around presently in two different ways: (although maybe only for Mac~OS~X and Linux)
\begin{enumerate}
\item Give |pdflatex| permission to write anywhere with the command:\\
|openout_any=a pdflatex ...|
@@ -648,10 +728,7 @@ One problem that \pkg{pstool} does not (currently) solve on its own is the inclu
\end{enumerate}
\section{Package information}
-The most recent publicly released version of \pkg{pstool} is available at \textsc{CTAN}:\\
-\centerline{\url{http://tug.ctan.org/pkg/pstool/}}\\
-Historical and developmental versions are available at GitHub:\\ \centerline{\url{http://github.com/wspr/pstool/}}\\
-While general feedback at \url{wspr81@gmail.com} is welcomed, specific bugs should be reported through the issue tracker at GitHub: \url{http://github.com/wspr/pstool/issues}.
+The most recent publicly released version of \pkg{pstool} is available at \textsc{ctan}: \url{http://tug.ctan.org/pkg/pstool/}. Historical and developmental versions are available at GitHub: \url{http://github.com/wspr/pstool/}. While general feedback via email is welcomed, specific bugs or feature requests should be reported through the issue tracker: \url{http://github.com/wspr/pstool/issues}.
\subsection{Licence}
@@ -665,4 +742,4 @@ This package is freely modifiable and distributable under the terms and conditio
\DocInput{pstool.sty}
{\addtocontents{toc}{\protect\end{varwidth}}}
-\end{document} \ No newline at end of file
+\end{document}
diff --git a/Master/texmf-dist/tex/latex/pstool/pstool.sty b/Master/texmf-dist/tex/latex/pstool/pstool.sty
index f4124251176..9de88ff656b 100644
--- a/Master/texmf-dist/tex/latex/pstool/pstool.sty
+++ b/Master/texmf-dist/tex/latex/pstool/pstool.sty
@@ -1,15 +1,14 @@
%% LaTeX2e file `pstool.sty'
%% generated by the `filecontents' environment
-%% from source `pstool' on 2009/07/03.
+%% from source `pstool' on 2009/07/21.
%%
-\ProvidesPackage{pstool}[2009/07/03 v1.2b
+\ProvidesPackage{pstool}[2009/07/17 v1.3
Wrapper for processing PostScript/psfrag figures]
% External packages
\RequirePackage{%
catchfile,color,ifpdf,ifplatform,
- graphicx,psfrag,suffix,xkeyval}
-\RequirePackage{inversepath}[2008/07/31 v0.2]
+ graphicx,pdftexcmds,psfrag,suffix,xkeyval}
% Allocations
\newif\if@pstool@pdfcrop@
@@ -37,13 +36,13 @@
\ExecuteOptionsX{process=auto}
\define@choicekey*{pstool.sty}{mode}
- [\@tempa\@tempb]{errorstop,nonstop,batch}{%
- \ifnum\@tempb=2\relax
- \@pstool@verbose@false
- \else
- \@pstool@verbose@true
- \fi
- \edef\pstool@mode{\@tempa mode}%
+ [\@tempa\@tempb]{errorstop,nonstop,batch}{%
+ \ifnum\@tempb=2\relax
+ \@pstool@verbose@false
+ \else
+ \@pstool@verbose@true
+ \fi
+ \edef\pstool@mode{\@tempa mode}%
}
\ExecuteOptionsX{mode=batch}
@@ -53,6 +52,29 @@
\DeclareOptionX{suffix}{\def\pstool@suffix{#1}}
\ExecuteOptionsX{suffix={-pstool}}
+% There is an implicit |\space| after the bitmap options.
+\define@choicekey*{pstool.sty}{bitmap}
+ [\@tempa\@tempb]{auto,lossless,lossy}{%
+ \ifcase\@tempb
+ \let\pstool@bitmap@opts\@empty
+ \or
+ \def\pstool@bitmap@opts{%
+ "-dAutoFilterColorImages=false"
+ "-dAutoFilterGrayImages=false"
+ "-dColorImageFilter=/FlateEncode"
+ "-dGrayImageFilter=/FlateEncode" % space
+ }
+ \or
+ \def\pstool@bitmap@opts{%
+ "-dAutoFilterColorImages=false"
+ "-dAutoFilterGrayImages=false"
+ "-dColorImageFilter=/DCTEncode"
+ "-dGrayImageFilter=/DCTEncode" % space
+ }
+ \fi
+}
+\ExecuteOptionsX{bitmap=lossless}
+
% \HideAllDefining
% \Define*{latex-options}
% \Define*{dvips-options}
@@ -63,11 +85,12 @@
\DeclareOptionX{ps2pdf-options}{\def\pstool@pspdf@opts{#1}}
\DeclareOptionX{pdfcrop-options}{\def\pstool@pdfcrop@opts{#1}}
% \ResumeAllDefining
-\ExecuteOptionsX{%
+\ExecuteOptionsX{
latex-options={},
dvips-options={},
- ps2pdf-options={},
- pdfcrop-options={}}
+ ps2pdf-options={"-dPDFSETTINGS=/prepress"},
+ pdfcrop-options={}
+}
\ifpdf
\ifshellescape\else
@@ -81,6 +104,11 @@
\ProcessOptionsX
+% A command to set \pkg{pstool} options after the package is loaded.
+\newcommand\pstoolsetup{%
+ \setkeys{pstool.sty}%
+}
+
% \section{Macros}
% Used to echo information to the console output.
@@ -89,7 +117,8 @@
\def\pstool@echo#1{%
\if@pstool@verbose@
\pstool@echo@verbose{#1}%
- \fi}
+ \fi
+}
\def\pstool@echo@verbose#1{%
\immediate\write18{echo "#1"}%
@@ -107,7 +136,9 @@
\newcommand\pstool@rm[2]{%
\OnlyIfFileExists{#1#2}{%
\immediate\write18{%
- cd "#1"\pstool@cmdsep\pstool@rm@cmd "#2"}}%
+ cd "#1"\pstool@cmdsep\pstool@rm@cmd "#2"
+ }%
+ }%
}
% Generic function to execute a command on the shell and pass its exit status back into \LaTeX. Any number of \cmd\pstool@exe\ statements can be made consecutively followed by \cmd\pstool@endprocess, which also takes an argument. If \emph{any} of the shell calls failed, then the execution immediately skips to the end and expands \cmd\pstool@error\ instead of the argument to \cmd\pstool@endprocess.
@@ -122,14 +153,19 @@
\ifnum\pstool@status > \z@
\PackageWarning{pstool}{Execution failed during process:^^J\space\space#3^^JThis warning occurred}%
\expandafter\pstool@abort
- \fi}
+ \fi
+}
% Edit this definition to print something else when graphic processing fails.
\def\pstool@error{%
\fbox{%
\parbox{0.8\linewidth}{%
\color{red}\raggedright\ttfamily\scshape\small
- An error occured processing graphic \upshape`\ip@directpath\ip@lastelement'}}}
+ An error occured processing graphic
+ \upshape`\pstool@path\pstool@filestub'%
+ }%
+ }%
+}
\def\pstool@abort#1\pstool@endprocess{\pstool@error\@gobble}
\let\pstool@endprocess\@firstofone
@@ -150,7 +186,8 @@
\ifwindows\else
\immediate\write18{%
touch #1\pstool@statusfile}%
- \fi}
+ \fi
+}
\def\pstool@statusfile{pstool-statusfile.txt}
% Read the exit status from the temporary file and delete it.\\
@@ -164,62 +201,52 @@
Status of process unable to be determined:^^J #1^^J%
Trying to proceed... }%
\def\pstool@status{0}%
- \fi}
+ \fi
+}
\def\pstool@statusfail{\par }% what results when \TeX\ reads an empty file
% \subsection{File age detection}
-% Use |ls| (or |dir|) to detect if the EPS is newer than the PDF.
\def\pstool@IfnewerEPS{%
- \edef\pstool@filenames{\ip@lastelement.eps\space \ip@lastelement.pdf\space}%
- \immediate\write18{%
- cd "\ip@directpath"\pstool@cmdsep
- \ifwindows
- dir /T:W /B /O-D "\ip@lastelement.eps" "\ip@lastelement.pdf" > \pstool@statusfile
- \else
- ls -t "\ip@lastelement.eps" "\ip@lastelement.pdf" > \pstool@statusfile
- \fi
- }%
- \pstool@retrievestatus{\ip@directpath}%
- \ifx\pstool@status\pstool@filenames
+ \ifnum\pdf@strcmp{\pdf@filemoddate{\pstool@path\pstool@filestub.pdf}}
+ {\pdf@filemoddate{\pstool@path\pstool@filestub.eps}}
+ < \z@
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}
-% A wrapper for \cs{inversepath*}. Long story short, always need a relative path to a filename even if it's in the same directory.
+% Grab filename and filepath. Always need a relative path to a filename even if it's in the same directory.
\def\pstool@getpaths#1{%
- \edef\@tempa{\unexpanded{\inversepath*}{#1}}%
- \@tempa% calculate filename, path \& inverse path
- \ifx\ip@directpath\@empty
- \def\ip@directpath{./}%
+ \filename@parse{#1}%
+ \ifx\filename@area\@empty
+ \def\pstool@path{./}%
+ \else
+ \let\pstool@path\filename@area
\fi
-% Strip off a possible wayward |.eps| suffix.
- \edef\ip@lastelement{%
- \expandafter\pstool@stripEPS\ip@lastelement.eps\@nil
- }%
+ \let\pstool@filestub\filename@base
}
-\def\pstool@stripEPS#1.eps#2\@nil{#1}
-% |test.eps\@nil| $\to$ |test| (|#2| $\to$ \<empty>)\\
-% |test.eps.eps\@nil| $\to$ |test| (|#2| $\to$ |.eps|)
-
% \section{Command parsing}
% User input is \cmd\pstool\ (with optional |*| or |!| suffix) which turns into one of the following three macros depending on the mode.
\newcommand\pstool@alwaysprocess[3][]{%
\pstool@getpaths{#2}%
- \pstool@process{#1}{#3}}
+ \pstool@process{#1}{#3}%
+}
\ifpdf
\newcommand\pstool@neverprocess[3][]{%
- \pstool@includegraphics{#2}}
+ \pstool@includegraphics{#2}%
+ }
\else
\newcommand\pstool@neverprocess[3][]{%
\begingroup
+ \setkeys*{pstool.sty}{#1}%
#3%
- \pstool@includegraphics[#1]{#2}%
- \endgroup}
+ \expandafter\pstool@includegraphics\expandafter[\XKV@rm]{#2}%
+ \endgroup
+ }
\fi
% For regular operation, which processes the figure only if
@@ -234,24 +261,33 @@
}%
}{%
\pstool@process{#1}{#3}%
- }}
+ }%
+}
% \section{User commands}
% Finally, define \cmd\pstool\ as appropriate for the mode: (|all|, |none|, |auto|, respectively)
\ifpdf
- \ifcase\pstool@process@choice
- \let\pstool\pstool@alwaysprocess
- \WithSuffix\def\pstool!{\pstool@alwaysprocess}
- \WithSuffix\def\pstool*{\pstool@alwaysprocess}
- \or
- \let\pstool\pstool@neverprocess
- \WithSuffix\def\pstool!{\pstool@neverprocess}
- \WithSuffix\def\pstool*{\pstool@neverprocess}
- \or
- \let\pstool\pstool@maybeprocess
- \WithSuffix\def\pstool!{\pstool@neverprocess}
- \WithSuffix\def\pstool*{\pstool@alwaysprocess}
- \fi
+ \newcommand\pstool{%
+ \ifcase\pstool@process@choice\relax
+ \expandafter \pstool@alwaysprocess \or
+ \expandafter \pstool@neverprocess \or
+ \expandafter \pstool@maybeprocess
+ \fi
+ }
+ \WithSuffix\def\pstool!{%
+ \ifcase\pstool@process@choice\relax
+ \expandafter \pstool@alwaysprocess \or
+ \expandafter \pstool@neverprocess \or
+ \expandafter \pstool@neverprocess
+ \fi
+ }
+ \WithSuffix\def\pstool*{%
+ \ifcase\pstool@process@choice\relax
+ \expandafter \pstool@alwaysprocess \or
+ \expandafter \pstool@neverprocess \or
+ \expandafter \pstool@alwaysprocess
+ \fi
+ }
\else
\let\pstool\pstool@neverprocess
\WithSuffix\def\pstool!{\pstool@neverprocess}
@@ -260,88 +296,97 @@
% \section{The figure processing}
-% \cmd\ip@lastelement\ is the filename of the figure stripped of its path (if any)
-\def\pstool@jobname{\ip@lastelement\pstool@suffix}
+% \cmd\pstool@filestub\ is the filename of the figure stripped of its path (if any)
+\def\pstool@jobname{\pstool@filestub\pstool@suffix}
% And this is the main macro.
\newcommand\pstool@process[2]{%
+ \begingroup
+ \setkeys*{pstool.sty}{#1}%
\pstool@echo@verbose{%
^^J^^J=== pstool: begin processing ===}%
\pstool@write@processfile{#1}
- {\ip@directpath\ip@lastelement}{#2}%
- \pstool@exe{auxiliary process: \ip@lastelement\space}
+ {\pstool@path\pstool@filestub}{#2}%
+ \pstool@exe{auxiliary process: \pstool@filestub\space}
{./}{latex
-shell-escape
-output-format=dvi
- -output-directory="\ip@directpath"
+ -output-directory="\pstool@path"
-interaction=\pstool@mode\space
\pstool@latex@opts\space
"\pstool@jobname.tex"}%
% Execute |dvips| in quiet mode if |latex| is not run in (non/error)stop mode:
- \pstool@exe{dvips}{\ip@directpath}{%
+ \pstool@exe{dvips}{\pstool@path}{%
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@exe{ps2pdf}{\pstool@path}{%
+ ps2pdf \pstool@bitmap@opts \pstool@pspdf@opts \space
"\pstool@jobname.ps" "\pstool@jobname.pdf"}%
- \pstool@exe{pdfcrop}{\ip@directpath}{%
+ \pstool@exe{pdfcrop}{\pstool@path}{%
pdfcrop \pstool@pdfcrop@opts\space
- "\pstool@jobname.pdf" "\ip@lastelement.pdf"}%
+ "\pstool@jobname.pdf" "\pstool@filestub.pdf"}%
\else
- \pstool@exe{ps2pdf}{\ip@directpath}{%
- ps2pdf \pstool@pspdf@opts\space
- "\pstool@jobname.ps" "\ip@lastelement.pdf"}%
+ \pstool@exe{ps2pdf}{\pstool@path}{%
+ ps2pdf \pstool@bitmap@opts \pstool@pspdf@opts \space
+ "\pstool@jobname.ps" "\pstool@filestub.pdf"}%
\fi
\pstool@endprocess{%
\pstool@cleanup
\pstool@includegraphics{%
- \ip@directpath\ip@lastelement}%
+ \pstool@path\pstool@filestub}%
}%
\pstool@echo@verbose{^^J=== pstool: end processing ===^^J}%
+ \endgroup
}
% 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
- \immediate\write\pstool@out{%
+ \immediate\openout\pstool@out #2\pstool@suffix.tex\relax
+ \immediate\write\pstool@out{%
% 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}%
- \noexpand\input{\jobname}^^J%
+ \unexpanded{%
+ \pdfoutput=0^^J% force DVI mode if not already
+ \let\origdocument\document^^J%
+ \let\EndPreamble\endinput^^J%
+ \def\document{\endgroup\endinput}^^J%
+ }%
+ \noexpand\input{\jobname}^^J%
%
% Now the preamble of the process file: (restoring document's original meaning; empty \cmd\pagestyle\ removes the page number)
- \if@pstool@pdfcrop@\else
- \noexpand\usepackage[active,tightpage]{preview}^^J%
- \fi
- \unexpanded{%
- \let\document\origdocument^^J%
- \pagestyle{empty}^^J}%
+ \if@pstool@pdfcrop@\else
+ \noexpand\usepackage[active,tightpage]{preview}^^J%
+ \fi
+ \unexpanded{%
+ \let\document\origdocument^^J%
+ \pagestyle{empty}^^J%
+ }%
%
% And the document body to place the graphic on a page of its own:
- \unexpanded{%
- \begin{document}^^J%
- \centering\null\vfill^^J}%
- \if@pstool@pdfcrop@\else
- \noexpand\begin{preview}^^J%
- \fi
- \unexpanded{#3^^J}% this is the "psfrag" material
- \noexpand\includegraphics[#1]{\ip@lastelement}^^J%
- \if@pstool@pdfcrop@\else
- \noexpand\end{preview}^^J%
- \fi
- \unexpanded{%
- \vfill\end{document}}^^J%
- }%
- \immediate\closeout\pstool@out}
+ \unexpanded{%
+ \begin{document}^^J%
+ \centering\null\vfill^^J%
+ }%
+ \if@pstool@pdfcrop@\else
+ \noexpand\begin{preview}^^J%
+ \fi
+ \unexpanded{#3^^J}% this is the "psfrag" material
+ \noexpand\includegraphics
+ [\unexpanded\expandafter{\XKV@rm}]
+ {\pstool@filestub}^^J%
+ \if@pstool@pdfcrop@\else
+ \noexpand\end{preview}^^J%
+ \fi
+ \unexpanded{\vfill\end{document}}^^J%
+ }%
+ \immediate\closeout\pstool@out
+}
\def\pstool@cleanup{%
\@for\@ii:=\pstool@rm@files\do{%
- \pstool@rm{\ip@directpath}{\pstool@jobname\@ii}%
-}}
+ \pstool@rm{\pstool@path}{\pstool@jobname\@ii}%
+ }%
+}
\providecommand\EndPreamble{}