texlive[45534] Master/texmf-dist: pstool (13oct17)

commits+karl at tug.org commits+karl at tug.org
Fri Oct 13 23:40:42 CEST 2017


Revision: 45534
          http://tug.org/svn/texlive?view=revision&revision=45534
Author:   karl
Date:     2017-10-13 23:40:42 +0200 (Fri, 13 Oct 2017)
Log Message:
-----------
pstool (13oct17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/pstool/README
    trunk/Master/texmf-dist/doc/latex/pstool/pstool.pdf
    trunk/Master/texmf-dist/source/latex/pstool/pstool.tex
    trunk/Master/texmf-dist/tex/latex/pstool/pstool.sty

Modified: trunk/Master/texmf-dist/doc/latex/pstool/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pstool/README	2017-10-13 21:40:26 UTC (rev 45533)
+++ trunk/Master/texmf-dist/doc/latex/pstool/README	2017-10-13 21:40:42 UTC (rev 45534)
@@ -1,7 +1,7 @@
-__________________
 The pstool package
+==================
 
-A package like "pst-pdf" for processing PostScript graphics
+A package like `pst-pdf` for processing PostScript graphics
 with psfrag labels within pdfLaTeX documents. The difference
 with this package is that every graphic is compiled individually,
 drastically speeding up compilation time when only a single
@@ -16,24 +16,28 @@
 
 Please see the PDF documentation for further information.
 
-Will Robertson & Zebb Prime
-Copyright 2008-2014
-Distributed under the LaTeX Project Public License, "maintained" by Will Robertson.
+* Copyright 2008–2014 Zebb Prime
+* Copyright 2008–2017 Will Robertson
+* Distributed under the LaTeX Project Public License, "maintained" by Will Robertson
 
-____________________
-Brief change history
 
-v1.5c
+Change history
+--------------------
+
+* v1.5d, Oct 2017:
+  - Use `shellesc` package for write18 in LuaTeX.
+
+* v1.5c:
   - Documentation update; some minor cosmetic code changes.
 
-v1.5b
+* v1.5b:
   - Fix conflict with beamer, which resets the catcode of @ with \begin{document}.
 
-v1.5a, March 2013:
+* v1.5a, March 2013:
   - Fix bug introduced in last version in which plain LaTeX compilation
     (producing DVI) produced erroneous output above each figure.
 
-v1.5, February 2013:
+* v1.5, February 2013:
   - Fix =/# mixup in Windows ps2pdf options.
   - Check the .tex file for newness when regenerating figures.
   - Add [macro-file=...] for a global file to retrieve psfrag macros
@@ -41,12 +45,12 @@
     Thanks to Heinrich Kruger for suggestions for the above.
   - Cross-references and citations within external graphics are now supported.
 
-v1.4, November 2010:
+* v1.4, November 2010:
   - More robust parsing of the main input file to read in the preamble.
     Therefore, \EndPreamble is now required much less often.
   - Apparently unreleased to CTAN, oops :)
 
-v1.3, July 2009:
+* 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.

Modified: trunk/Master/texmf-dist/doc/latex/pstool/pstool.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/pstool/pstool.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/pstool/pstool.tex	2017-10-13 21:40:26 UTC (rev 45533)
+++ trunk/Master/texmf-dist/source/latex/pstool/pstool.tex	2017-10-13 21:40:42 UTC (rev 45534)
@@ -1,73 +1,15 @@
 \RequirePackage{filecontents}
-\begin{filecontents*}{README.txt}
-__________________
-The pstool package
 
-A package like "pst-pdf" for processing PostScript graphics
-with psfrag labels within pdfLaTeX documents. 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.
-
-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-2014
-Distributed under the LaTeX Project Public License, "maintained" by Will Robertson.
-
-____________________
-Brief change history
-
-v1.5c
-  - Documentation update; some minor cosmetic code changes.
-
-v1.5b
-  - Fix conflict with beamer, which resets the catcode of @ with \begin{document}.
-
-v1.5a, March 2013:
-  - Fix bug introduced in last version in which plain LaTeX compilation
-    (producing DVI) produced erroneous output above each figure.
-
-v1.5, February 2013:
-  - Fix =/# mixup in Windows ps2pdf options.
-  - Check the .tex file for newness when regenerating figures.
-  - Add [macro-file=...] for a global file to retrieve psfrag macros
-    (default is "\jobname-pstool.tex").
-    Thanks to Heinrich Kruger for suggestions for the above.
-  - Cross-references and citations within external graphics are now supported.
-
-v1.4, November 2010:  
-  - More robust parsing of the main input file to read in the preamble.
-    Therefore, \EndPreamble is now required much less often.
-  - Apparently unreleased to CTAN, oops :)
-
-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}
 % TODO: convert this package into expl3 syntax (will save many lines of code).
 
-\ProvidesPackage{pstool}[2014/05/11 v1.5c
+\ProvidesPackage{pstool}[2017/10/13 v1.5d
   Wrapper for processing PostScript/psfrag figures]
 
 % External packages:
 \RequirePackage{
   catchfile,color,ifpdf,ifplatform,filemod,
-  graphicx,psfrag,suffix,trimspaces,xkeyval,expl3
+  graphicx,psfrag,shellesc,suffix,trimspaces,xkeyval,expl3
 }
 
 % Add an additional command before trimspaces.sty is updated formally:
@@ -217,7 +159,7 @@
 }
 
 \def\pstool at echo@verbose#1{%
-  \immediate\write18{echo "#1"}%
+  \ShellEscape{echo "#1"}%
 }
 
 \let\pstool at includegraphics\includegraphics
@@ -227,33 +169,33 @@
 \edef\pstool at rm@cmd{\ifwindows del \else rm -- \fi}
 \edef\pstool at cp@cmd{\ifwindows copy \else cp -- \fi}
 
-% Delete a file if it exists:
-% #1: path
-% #2: filename
+% Delete a file if it exists:\\
+% \#1: path\\
+% \#2: filename
 \newcommand\pstool at rm[2]{%
   \IfFileExists{#1#2}{%
-    \immediate\write18{%
+    \ShellEscape{%
       cd "#1"\pstool at cmdsep\pstool at rm@cmd "#2"
     }%
   }{}%
 }
 
-% Copy a file if it exists:
-% #1: path
-% #2: filename
-% #3: new filename
+% Copy a file if it exists:\\
+% \#1: path\\
+% \#2: filename\\
+% \#3: new filename
 \newcommand\pstool at cp[3]{%
   \IfFileExists{#1#2}{%
-    \immediate\write18{%
+    \ShellEscape{%
       cd "#1"\pstool at cmdsep\pstool at cp@cmd "#2" "#3"
     }%
   }{}%
 }
 
-% Generic function to execute a command on the shell and pass its exit status back into \LaTeX. Any number of \cmd\pstool at exe\ statements can be made consecutively followed by \cmd\pstool at 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 at error\ instead of the argument to \cmd\pstool at endprocess.
-% #1: `name' of process
-% #2: relative path where to execute the command
-% #3: the command itself
+% Generic function to execute a command on the shell and pass its exit status back into \LaTeX. Any number of \cmd\pstool at exe\ statements can be made consecutively followed by \cmd\pstool at 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 at error\ instead of the argument to \cmd\pstool at endprocess.\\
+% \#1: `name' of process
+% \#2: relative path where to execute the command
+% \#3: the command itself
 \newcommand\pstool at exe[3]{%
   \pstool at echo{^^J=== pstool: #1 ===}%
   \pstool at shellexecute{#2}{#3}%
@@ -292,7 +234,7 @@
 
 % It is necessary while executing commands on the shell to write the exit status to a temporary file to test for failures in processing. (If all versions of \texttt{pdflatex} supported input pipes, things might be different.)
 \def\pstool at shellexecute#1#2{%
-  \immediate\write18{%
+  \ShellEscape{%
     cd "#1" \pstool at cmdsep
     #2 \pstool at cmdsep
     \ifwindows
@@ -304,7 +246,7 @@
     > \pstool at statusfile}%
 % That's the execution; now we need to flush the write buffer to the status file. This ensures the file is written to disk properly (allowing it to be read by \cmd\CatchFileEdef). Not necessary on Windows, whose file writing is evidently more crude/immediate.
   \ifwindows\else
-    \immediate\write18{%
+    \ShellEscape{%
       touch #1\pstool at statusfile}%
   \fi
 }
@@ -311,7 +253,7 @@
 \def\pstool at statusfile{pstool-statusfile.txt}
 
 % Read the exit status from the temporary file and delete it.
-% #1 is the path
+% \#1 is the path
 % Status is recorded in \cmd\pstool at status.
 \def\pstool at retrievestatus#1{%
   \CatchFileEdef{\pstool at status}{#1\pstool at statusfile}{}%
@@ -363,9 +305,9 @@
   }
 \fi
 
-% Process the figure when:
-% -- the PDF file doesn't exist, or
-% -- the EPS is newer than the PDF, or
+% Process the figure when:\\
+% -- the PDF file doesn't exist, or\\
+% -- the EPS is newer than the PDF, or\\
 % -- the TeX file is new than the PDF.
 \ExplSyntaxOn
 \newcommand\pstool at maybeprocess[3][]
@@ -485,7 +427,7 @@
 }
 
 \newcommand\pstool at write@aux{%
-  \endlinechar=-1
+  \endlinechar=-1\relax
   \@tempswatrue 
   \@pstool at write@auxfalse
   \in at false
@@ -508,7 +450,7 @@
         \fi
       \fi
     \fi
-  }
+  }%
   \closein \pstool at auxfile@ior  
 }
 
@@ -548,7 +490,7 @@
   \pstool at rm{\pstool at path}{\pstool at jobname.bbl}%
   \pstool at cp{}{\jobname.bbl}{\pstool at path\pstool at 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
+  \endlinechar=-1\relax
   \def\@tempa{\pdfoutput=0\relax}% 
   \in at false
   \openin\pstool at mainfile@ior "\jobname"\relax 
@@ -646,12 +588,11 @@
   }%
 }
 
-% Search for both `filename' and `filename'-psfrag inputs.
-%
-% #1: possible graphicx options
-% #2: graphic name (possibly with path)
-% #3: \cs{pstool} suffix (i.e., \texttt{!} or \texttt{*} or `empty')
-% #4: possible \pkg{psfrag} (or other) macros
+% Search for both `filename' and `filename'-psfrag inputs.\\
+% \#1: possible graphicx options\\
+% \#2: graphic name (possibly with path)\\
+% \#3: \cs{pstool} suffix (i.e., \texttt{!} or \texttt{*} or `empty')\\
+% \#4: possible \pkg{psfrag} (or other) macros
 \newcommand\pstool@@psfragfig[4]{%
   % Find the .eps file to use.
   \IfFileExists{#2-psfrag.eps}{%
@@ -738,11 +679,7 @@
 
 \usepackage{xcolor}
 \usepackage[colorlinks,linktocpage]{hyperref}
-%\usepackage{gmdoc}
-%\usepackage{gmverb}
-%\dekclubs
-%\stanzaskip=\bigskipamount 
-%\CodeSpacesGrey
+\usepackage{expl3,l3regex}
 
 \usepackage{enumitem}
 \setlist{noitemsep}
@@ -1041,123 +978,174 @@
 
 \parindent=0pt
 
+
 \ExplSyntaxOn
 
-\ior_new:N \pstool_doc_ior
-\seq_new:N \l_pstool_line_seq
-\tl_new:N \l_pstool_tl
+\ior_new:N \pprint_doc_ior
+\seq_new:N \l_pprint_line_seq
+\tl_new:N \l_pprint_tl
 
-\tl_const:Nx \c_pstool_percent_str { \cs_to_str:N \% }
-\tl_const:Nx \c_pstool_lbrace_str { \cs_to_str:N \{ }
-\tl_const:Nx \c_pstool_rbrace_str { \cs_to_str:N \} }
+\int_new:N \g_pprint_indent_int
+\int_new:N \l_pprint_line_indent_int
+\dim_new:N \l_pprint_dim
 
-\cs_new:Nn \pstool_typeset_percent:
+\errorcontextlines=999
+
+\tl_set:Nx \g_pprint_comment_tl { \cs_to_str:N \% }
+\definecolor{commentstrcolor}{rgb}{0,0.7,0}
+\definecolor{numberscolor}{gray}{0.6}
+
+\def\linecommentstyle{%
+  \sffamily
+  \color{commentstrcolor}%
+}
+
+\cs_new:Nn \pprint_scan_setup:
  {
-  \group_begin:
-    \color{blue}
-    \scriptsize\bfseries
-    \c_pstool_percent_str
-  \group_end:
+  \char_set_catcode_space:N \ 
+%    \char_set_catcode_other:N \\
+%    \char_set_catcode_space:N \ % space
+%    \char_set_catcode_letter:N \#
+%    \char_set_catcode_letter:N \$
+%    \char_set_catcode_letter:N \^
+%    \char_set_catcode_letter:N \_
+%    \char_set_catcode_letter:N \& 
  }
 
-\cs_new:Nn \pstool_doc_rescan_line:
+%%%%
+
+\cs_new:Npn \PrettyPrint #1
  {
-  \exp_args:Nno \tl_rescan:nn
+\int_new:N \g_pprint_docline_int
+\ior_open:Nn \pprint_doc_ior {#1}
+
+\cs_generate_variant:Nn \tl_if_eq:nnTF {x}
+
+\cs_set_eq:NN \___tl_trim_spaces:n \tl_trim_spaces:n
+\ior_str_map_inline:Nn \pprint_doc_ior
+ {
+  \int_gincr:N \g_pprint_docline_int
+
+  % avoid space trimming inside \seq_set_split:n following:
+  % (MAJOR SIDE-EFFECTS OF COURSE)
+  \cs_set_eq:NN \tl_trim_spaces:n \use:n
+  \exp_args:NNo \seq_set_split:Nnn \l_pprint_line_seq \g_pprint_comment_tl {##1}
+  \cs_set_eq:NN \tl_trim_spaces:n \___tl_trim_spaces:n
+  
+  \seq_pop_left:NNT \l_pprint_line_seq \l_pprint_tl
    {
-    \char_set_catcode_space:N \ % space
-    \char_set_catcode_letter:N \#
+    \tl_if_empty:NTF \l_pprint_tl
+     {
+       \pprint_doc_line_comment:
+     }
+     {
+       \pprint_doc_line_code: 
+     }
    }
-   { \l_pstool_tl }
  }
+ }
 
-\cs_new:Nn \pstool_doc_line_comment:
+\cs_generate_variant:Nn \tl_if_eq:nnTF {o}
+\cs_new:Nn \pprint_doc_line_comment:
  {
-  \seq_pop_left:NNTF \l_pstool_line_seq \l_pstool_tl
+  \seq_pop_left:NNTF \l_pprint_line_seq \l_pprint_tl
    % Comment on a line of its own:
    {
-    \group_begin:
-    \int_compare:nT { \g_pstool_indent_int > 0 } { \color{blue}\small }
-    \pstool_doc_rescan_line:
-    \group_end:
-    \par
+    \seq_put_right:No \l_pprint_codelines_seq \l_pprint_tl
    }
    % A completely empty line:
    {
+    \pprint_flush_codelines:
     \vspace{\baselineskip}
    }
  }
 
-\int_new:N \g_pstool_indent_int
-\int_new:N \l_pstool_line_indent_int
-\dim_new:N \l_pstool_dim
+\cs_new:Nn \pprint_rescan_comment:n
+ {
+  \exp_args:Nno \tl_rescan:nn
+   {
+    \pprint_scan_setup:
+   }
+   { #1 }
+ }
 
-\cs_new:Nn \pstool_doc_line_code:
+\cs_new:Nn \pprint_typeset_startcomment:
  {
-  \makebox[0pt][r]{\scriptsize\color{blue}\int_use:N \g_pstool_docline_int\quad}
-  
-  \int_zero:N \l_pstool_line_indent_int
-  \tl_map_inline:Nn \l_pstool_tl
+  \group_begin:
+    \bfseries
+    \g_pprint_comment_tl
+  \group_end:
+ }
+
+\cs_generate_variant:Nn \regex_extract_once:nnNTF {no}
+\cs_generate_variant:Nn \tl_if_in:nnT {xx}
+\seq_new:N \l_tmp_seq
+
+\seq_new:N \l_pprint_codelines_seq
+
+\int_new:N \g_pprint_brace_int
+\cs_new:Nn \pprint_lbrace:
+ {
+  \peek_meaning_remove:NTF \pprint_rbrace:
+   { \char`\{\char`\} }
    {
-    \str_if_eq_x:nnT {##1} {\c_pstool_lbrace_str} { \int_gincr:N \l_pstool_line_indent_int }
-    \str_if_eq_x:nnT {##1} {\c_pstool_rbrace_str} { \int_gdecr:N \l_pstool_line_indent_int }
+    \int_gincr:N \g_pprint_brace_int
+    \char`\{\pprint_brace_sub:
    }
-  \exp_args:NNx \tl_if_in:NnT \l_pstool_tl { \token_to_str:N \if } { \int_gincr:N \l_pstool_line_indent_int }
-  \exp_args:NNx \tl_if_in:NnT \l_pstool_tl { \token_to_str:N \fi } { \int_gdecr:N \l_pstool_line_indent_int }
+ }
+\cs_new:Nn \pprint_rbrace:
+ {
+  \pprint_brace_sub:\char`\}
+  \int_gdecr:N \g_pprint_brace_int
+ }
+\cs_new:Nn \pprint_brace_sub:
+ {
+  {${}\sb{\sb{ \color{red}\mathbf{\int_use:N \g_pprint_brace_int} }}$}
+ }
 
-  \int_compare:nT { \l_pstool_line_indent_int < 0 }
-   { \int_set:Nn \g_pstool_indent_int { \g_pstool_indent_int + \l_pstool_line_indent_int } }
-  \int_compare:nT { \g_pstool_indent_int > 0 }
-   { \prg_replicate:nn {\g_pstool_indent_int} {\quad} }
-  \int_compare:nT { \l_pstool_line_indent_int > 0 }
-   { \int_set:Nn \g_pstool_indent_int { \g_pstool_indent_int + \l_pstool_line_indent_int } }
-  \int_compare:nT { \g_pstool_indent_int < 0 }
-   { \int_zero:N \g_pstool_indent_int }
+
+\cs_new:Nn \pprint_doc_line_code:
+ {
+  \pprint_flush_codelines:
+
+  \makebox[2em][l]{\tiny\color{numberscolor}\int_use:N \g_pprint_docline_int}
+  \exp_args:NNx \tl_replace_all:Nnn \l_pprint_tl { \cs_to_str:N \{ } { \pprint_lbrace: }
+  \exp_args:NNx \tl_replace_all:Nnn \l_pprint_tl { \cs_to_str:N \} } { \pprint_rbrace: }
+  \makebox{\texttt{\l_pprint_tl}}
   
-  \texttt{\l_pstool_tl}
-  
-  \seq_pop_left:NNT \l_pstool_line_seq \l_pstool_tl
+  \seq_pop_left:NNT \l_pprint_line_seq \l_pprint_tl
    {
     \makebox
      {%
-      \pstool_typeset_percent:
-      \space
-      \small
-      \color{blue}%
-      \pstool_doc_rescan_line:
+      \linecommentstyle
+      \pprint_typeset_startcomment:\space
+      \pprint_rescan_comment:n { \l_pprint_tl }
      }
    }
   \par
  }
 
-\errorcontextlines=999
-
-\int_new:N \g_pstool_docline_int
-\ior_open:Nn \pstool_doc_ior {pstool.sty}
-
-\cs_set_eq:NN \___tl_trim_spaces:n \tl_trim_spaces:n
-\cs_set_eq:NN \tl_trim_spaces:n \use:n % avoid space trimming inside \seq_set_split:n following (MAJOR SIDE-EFFECTS OF COURSE)
-\ior_str_map_inline:Nn \pstool_doc_ior
+\cs_new:Nn \pprint_flush_codelines:
  {
-  \int_gincr:N \g_pstool_docline_int
-  \exp_args:NNo \seq_set_split:Nnn \l_pstool_line_seq {\c_pstool_percent_str} {#1}
-  %\seq_show:N \l_pstool_line_seq
-  \seq_pop_left:NNT \l_pstool_line_seq \l_pstool_tl
+  \seq_if_empty:NF \l_pprint_codelines_seq
    {
-    \tl_if_empty:NTF \l_pstool_tl
+    \medskip
+    \seq_map_inline:Nn \l_pprint_codelines_seq
      {
-       \pstool_doc_line_comment:
+      \pprint_rescan_comment:n {##1}
+      \space   
      }
-     {
-       \pstool_doc_line_code: 
-     }
+    \seq_clear:N \l_pprint_codelines_seq
+    \smallskip
+    \par
    }
  }
-\cs_set_eq:NN \tl_trim_spaces:n \___tl_trim_spaces:n
 
 \ExplSyntaxOff
 
-%\DocInput{pstool.sty}
+\PrettyPrint {pstool.sty}
 
+
 {\addtocontents{toc}{\protect\end{varwidth}}}
 \end{document}
 

Modified: trunk/Master/texmf-dist/tex/latex/pstool/pstool.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pstool/pstool.sty	2017-10-13 21:40:26 UTC (rev 45533)
+++ trunk/Master/texmf-dist/tex/latex/pstool/pstool.sty	2017-10-13 21:40:42 UTC (rev 45534)
@@ -1,12 +1,12 @@
 % TODO: convert this package into expl3 syntax (will save many lines of code).
 
-\ProvidesPackage{pstool}[2014/05/11 v1.5c
+\ProvidesPackage{pstool}[2017/10/13 v1.5d
   Wrapper for processing PostScript/psfrag figures]
 
 % External packages:
 \RequirePackage{
   catchfile,color,ifpdf,ifplatform,filemod,
-  graphicx,psfrag,suffix,trimspaces,xkeyval,expl3
+  graphicx,psfrag,shellesc,suffix,trimspaces,xkeyval,expl3
 }
 
 % Add an additional command before trimspaces.sty is updated formally:
@@ -156,7 +156,7 @@
 }
 
 \def\pstool at echo@verbose#1{%
-  \immediate\write18{echo "#1"}%
+  \ShellEscape{echo "#1"}%
 }
 
 \let\pstool at includegraphics\includegraphics
@@ -166,33 +166,33 @@
 \edef\pstool at rm@cmd{\ifwindows del \else rm -- \fi}
 \edef\pstool at cp@cmd{\ifwindows copy \else cp -- \fi}
 
-% Delete a file if it exists:
-% #1: path
-% #2: filename
+% Delete a file if it exists:\\
+% \#1: path\\
+% \#2: filename
 \newcommand\pstool at rm[2]{%
   \IfFileExists{#1#2}{%
-    \immediate\write18{%
+    \ShellEscape{%
       cd "#1"\pstool at cmdsep\pstool at rm@cmd "#2"
     }%
   }{}%
 }
 
-% Copy a file if it exists:
-% #1: path
-% #2: filename
-% #3: new filename
+% Copy a file if it exists:\\
+% \#1: path\\
+% \#2: filename\\
+% \#3: new filename
 \newcommand\pstool at cp[3]{%
   \IfFileExists{#1#2}{%
-    \immediate\write18{%
+    \ShellEscape{%
       cd "#1"\pstool at cmdsep\pstool at cp@cmd "#2" "#3"
     }%
   }{}%
 }
 
-% Generic function to execute a command on the shell and pass its exit status back into \LaTeX. Any number of \cmd\pstool at exe\ statements can be made consecutively followed by \cmd\pstool at 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 at error\ instead of the argument to \cmd\pstool at endprocess.
-% #1: `name' of process
-% #2: relative path where to execute the command
-% #3: the command itself
+% Generic function to execute a command on the shell and pass its exit status back into \LaTeX. Any number of \cmd\pstool at exe\ statements can be made consecutively followed by \cmd\pstool at 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 at error\ instead of the argument to \cmd\pstool at endprocess.\\
+% \#1: `name' of process
+% \#2: relative path where to execute the command
+% \#3: the command itself
 \newcommand\pstool at exe[3]{%
   \pstool at echo{^^J=== pstool: #1 ===}%
   \pstool at shellexecute{#2}{#3}%
@@ -231,7 +231,7 @@
 
 % It is necessary while executing commands on the shell to write the exit status to a temporary file to test for failures in processing. (If all versions of \texttt{pdflatex} supported input pipes, things might be different.)
 \def\pstool at shellexecute#1#2{%
-  \immediate\write18{%
+  \ShellEscape{%
     cd "#1" \pstool at cmdsep
     #2 \pstool at cmdsep
     \ifwindows
@@ -243,7 +243,7 @@
     > \pstool at statusfile}%
 % That's the execution; now we need to flush the write buffer to the status file. This ensures the file is written to disk properly (allowing it to be read by \cmd\CatchFileEdef). Not necessary on Windows, whose file writing is evidently more crude/immediate.
   \ifwindows\else
-    \immediate\write18{%
+    \ShellEscape{%
       touch #1\pstool at statusfile}%
   \fi
 }
@@ -250,7 +250,7 @@
 \def\pstool at statusfile{pstool-statusfile.txt}
 
 % Read the exit status from the temporary file and delete it.
-% #1 is the path
+% \#1 is the path
 % Status is recorded in \cmd\pstool at status.
 \def\pstool at retrievestatus#1{%
   \CatchFileEdef{\pstool at status}{#1\pstool at statusfile}{}%
@@ -302,9 +302,9 @@
   }
 \fi
 
-% Process the figure when:
-% -- the PDF file doesn't exist, or
-% -- the EPS is newer than the PDF, or
+% Process the figure when:\\
+% -- the PDF file doesn't exist, or\\
+% -- the EPS is newer than the PDF, or\\
 % -- the TeX file is new than the PDF.
 \ExplSyntaxOn
 \newcommand\pstool at maybeprocess[3][]
@@ -424,7 +424,7 @@
 }
 
 \newcommand\pstool at write@aux{%
-  \endlinechar=-1
+  \endlinechar=-1\relax
   \@tempswatrue
   \@pstool at write@auxfalse
   \in at false
@@ -447,7 +447,7 @@
         \fi
       \fi
     \fi
-  }
+  }%
   \closein \pstool at auxfile@ior
 }
 
@@ -487,7 +487,7 @@
   \pstool at rm{\pstool at path}{\pstool at jobname.bbl}%
   \pstool at cp{}{\jobname.bbl}{\pstool at path\pstool at 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
+  \endlinechar=-1\relax
   \def\@tempa{\pdfoutput=0\relax}%
   \in at false
   \openin\pstool at mainfile@ior "\jobname"\relax
@@ -585,12 +585,11 @@
   }%
 }
 
-% Search for both `filename' and `filename'-psfrag inputs.
-%
-% #1: possible graphicx options
-% #2: graphic name (possibly with path)
-% #3: \cs{pstool} suffix (i.e., \texttt{!} or \texttt{*} or `empty')
-% #4: possible \pkg{psfrag} (or other) macros
+% Search for both `filename' and `filename'-psfrag inputs.\\
+% \#1: possible graphicx options\\
+% \#2: graphic name (possibly with path)\\
+% \#3: \cs{pstool} suffix (i.e., \texttt{!} or \texttt{*} or `empty')\\
+% \#4: possible \pkg{psfrag} (or other) macros
 \newcommand\pstool@@psfragfig[4]{%
   % Find the .eps file to use.
   \IfFileExists{#2-psfrag.eps}{%



More information about the tex-live-commits mailing list