texlive[64663] Master/texmf-dist: iexec (9oct22)

commits+karl at tug.org commits+karl at tug.org
Sun Oct 9 22:17:02 CEST 2022


Revision: 64663
          http://tug.org/svn/texlive?view=revision&revision=64663
Author:   karl
Date:     2022-10-09 22:17:02 +0200 (Sun, 09 Oct 2022)
Log Message:
-----------
iexec (9oct22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/iexec/DEPENDS.txt
    trunk/Master/texmf-dist/doc/latex/iexec/iexec.pdf
    trunk/Master/texmf-dist/source/latex/iexec/iexec.dtx
    trunk/Master/texmf-dist/source/latex/iexec/iexec.ins
    trunk/Master/texmf-dist/tex/latex/iexec/iexec.sty

Modified: trunk/Master/texmf-dist/doc/latex/iexec/DEPENDS.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/iexec/DEPENDS.txt	2022-10-09 20:16:32 UTC (rev 64662)
+++ trunk/Master/texmf-dist/doc/latex/iexec/DEPENDS.txt	2022-10-09 20:17:02 UTC (rev 64663)
@@ -1,3 +1,4 @@
 hard shellesc
 hard pgfkeys
 hard xkeyval
+hard expl3

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

Modified: trunk/Master/texmf-dist/source/latex/iexec/iexec.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/iexec/iexec.dtx	2022-10-09 20:16:32 UTC (rev 64662)
+++ trunk/Master/texmf-dist/source/latex/iexec/iexec.dtx	2022-10-09 20:17:02 UTC (rev 64663)
@@ -50,17 +50,14 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{iexec}
 %<*package>
-[01.10.2022 0.6.1 Inputable Shell Executions]
+[09.10.20220 0.7.0 Inputable Shell Executions]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
 \usepackage[tt=false, type1=true]{libertine}
+\usepackage{microtype}
 \usepackage{iexec}
 \usepackage{href-ul}
-\raggedbottom
-\setlength{\parindent}{0pt}
-\setlength{\columnsep}{32pt}
-\setlength{\parskip}{6pt}
 \PageIndex
 \EnableCrossrefs
 \CodelineIndex
@@ -105,7 +102,7 @@
 %
 % \columnbreak
 %
-% Today is \iexec{date +\%e-\%b-\%Y}
+% Today is \iexec[log]{date +\%e-\%b-\%Y}
 % \end{multicols}
 
 % \begin{macro}{\iexec}
@@ -184,6 +181,43 @@
 %\fi
 % \end{macro}
 
+% \begin{macro}{append}
+% The stdout produced will be appended to the file specified:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\documentclass{article}
+\usepackage[trace]{iexec}
+\begin{document}
+\iexec[append,stdout=foo.txt,quiet]{echo 'Hello, '}
+\iexec[append,stdout=foo.txt,quiet]{echo 'Jeffrey!'}
+\input{foo.txt}
+\end{document}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% \end{macro}
+
+% \begin{macro}{log}
+% The stdout produced will be printed in \TeX{} log:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\documentclass{article}
+\usepackage{iexec}
+\begin{document}
+\iexec[log]{echo 'Hello, \\LaTeX!'}
+\input{foo.txt}
+\end{document}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% \end{macro}
+
 % \StopEventually{}
 
 % \section{Implementation}
@@ -193,9 +227,15 @@
 % \changes{v0.4.1}{2021/08/08}{Options trace, stdout, and quiet added}
 % \changes{v0.5.0}{2022/01/08}{Major bug fixes}
 
-% \iffalse
+% First, we include a few packages:
+%    \begin{macrocode}
 \RequirePackage{shellesc}
 \RequirePackage{pgfkeys}
+\RequirePackage{expl3}
+%    \end{macrocode}
+
+% Then, we parse package options:
+%    \begin{macrocode}
 \RequirePackage{xkeyval}
 \makeatletter\newif\ifiexec at trace
 \DeclareOptionX{trace}{\iexec at tracetrue}
@@ -206,12 +246,34 @@
   stdout/.estore in = \iexec at stdout,
   stdout/.default = iexec.tmp,
   trace/.estore in = \iexec at traceit,
+  append/.estore in = \iexec at append,
+  log/.estore in = \iexec at log,
   quiet/.estore in = \iexec at quiet,
   stdout
 }\makeatother
-% \fi
+%    \end{macrocode}
 
+% \begin{macro}{\iexec at typeout}
+% Then, we define an internal command |\iexec at typeout| for printing the content of a file,
+% as suggested \href{https://tex.stackexchange.com/questions/660808}{here}:
+%    \begin{macrocode}
+\makeatletter\ExplSyntaxOn
+\NewDocumentCommand{\iexec at typeout}{m}{
+  \iexec_typeout_file:n { #1 }}
+\ior_new:N \g_iexec_typeout_ior
+\cs_new_protected:Nn \iexec_typeout_file:n
+{
+  \ior_open:Nn \g_iexec_typeout_ior { #1 }
+  \ior_str_map_inline:Nn \g_iexec_typeout_ior
+    {\iow_term:n { ##1 }}
+  \ior_close:N \g_iexec_typeout_ior
+}
+\ExplSyntaxOff\makeatother
+%    \end{macrocode}
+% \end{macro}
+
 % \begin{macro}{\iexec}
+% Then, we define |\iexec| command.
 % It is implemented with the help of |\ShellEscape| from |shellesc| package:
 %    \begin{macrocode}
 \makeatletter\newcommand\iexec[2][]{%
@@ -222,7 +284,7 @@
 % it nothing will work; so, it's better to throw an error earlier than later:
 %    \begin{macrocode}
     \ifdefined\pdfshellescape\ifnum\pdfshellescape=1\else%
-      \PackageError{iexec}{You must run latex with
+      \PackageError{iexec}{You must run TeX processor with
       --shell-escape option}{}%
     \fi\fi%
     \begingroup%
@@ -238,7 +300,7 @@
 %    \end{macrocode}
 % Then, we execute it:
 %    \begin{macrocode}
-      \ShellEscape{#2 > \iexec at stdout}%
+      \ShellEscape{#2 \ifdefined\iexec at append>\fi> \iexec at stdout}%
 %    \end{macrocode}
 % Then, a message is printed to TeX log:
 %    \begin{macrocode}
@@ -245,12 +307,22 @@
       \message{^^Jiexec: [#2 > \iexec at stdout]^^J}%
     \endgroup%
 %    \end{macrocode}
+% Then, if required, the content of the stdout file will be printed to the log:
+%    \begin{macrocode}
+    \ifdefined\iexec at log
+      \message{^^Jiexec: this is the content of \iexec at stdout:^^J}%
+      \iexec at typeout{\iexec at stdout}
+      \message{^^J<EOF>^^J}%
+    \fi%
+%    \end{macrocode}
 % Then, include the produced output into the current document:
 %    \begin{macrocode}
     \ifdefined\iexec at quiet
-      \message{^^Jiexec: Due to 'quiet' we didn't read
-      the content of '\iexec at stdout'^^J}%
+      \message{^^Jiexec: Due to 'quiet' option we didn't read
+      the content of '\iexec at stdout' (\pdffilesize{} bytes)^^J}%
     \else%
+      \message{^^Jiexec: We include the content of
+        '\iexec at stdout' (\pdffilesize{} bytes)...^^J}%
       \input{\iexec at stdout}%
       \message{^^Jiexec: The content of '\iexec at stdout'
       was included into the document^^J}%

Modified: trunk/Master/texmf-dist/source/latex/iexec/iexec.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/iexec/iexec.ins	2022-10-09 20:16:32 UTC (rev 64662)
+++ trunk/Master/texmf-dist/source/latex/iexec/iexec.ins	2022-10-09 20:17:02 UTC (rev 64663)
@@ -48,8 +48,8 @@
 \endpreamble
 \generate{\file{iexec.sty}{\from{iexec.dtx}{package}}}
 \obeyspaces
-\Msg{*** To finish the installation you have to move the ".sty"}
-\Msg{*** file into a directory searched by TeX. To produce the}
-\Msg{*** documentation run the file ".dtx" through LaTeX. If any}
-\Msg{*** questions, submit a new GitHub issue.}
+\Msg{To finish the installation you have to move the ".sty"}
+\Msg{file into a directory searched by TeX. To produce the}
+\Msg{documentation run the file ".dtx" through LaTeX. If any}
+\Msg{questions, submit a new GitHub issue.}
 \endbatchfile

Modified: trunk/Master/texmf-dist/tex/latex/iexec/iexec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/iexec/iexec.sty	2022-10-09 20:16:32 UTC (rev 64662)
+++ trunk/Master/texmf-dist/tex/latex/iexec/iexec.sty	2022-10-09 20:17:02 UTC (rev 64663)
@@ -31,7 +31,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{iexec}
-[01.10.2022 0.6.1 Inputable Shell Executions]
+[09.10.20220 0.7.0 Inputable Shell Executions]
 
 
 
@@ -43,8 +43,12 @@
 
 
 
+
+
 \RequirePackage{shellesc}
 \RequirePackage{pgfkeys}
+\RequirePackage{expl3}
+
 \RequirePackage{xkeyval}
 \makeatletter\newif\ifiexec at trace
 \DeclareOptionX{trace}{\iexec at tracetrue}
@@ -55,15 +59,30 @@
   stdout/.estore in = \iexec at stdout,
   stdout/.default = iexec.tmp,
   trace/.estore in = \iexec at traceit,
+  append/.estore in = \iexec at append,
+  log/.estore in = \iexec at log,
   quiet/.estore in = \iexec at quiet,
   stdout
 }\makeatother
 
+\makeatletter\ExplSyntaxOn
+\NewDocumentCommand{\iexec at typeout}{m}{
+  \iexec_typeout_file:n { #1 }}
+\ior_new:N \g_iexec_typeout_ior
+\cs_new_protected:Nn \iexec_typeout_file:n
+{
+  \ior_open:Nn \g_iexec_typeout_ior { #1 }
+  \ior_str_map_inline:Nn \g_iexec_typeout_ior
+    {\iow_term:n { ##1 }}
+  \ior_close:N \g_iexec_typeout_ior
+}
+\ExplSyntaxOff\makeatother
+
 \makeatletter\newcommand\iexec[2][]{%
   \begingroup
     \pgfqkeys{/iexec}{#1}%
     \ifdefined\pdfshellescape\ifnum\pdfshellescape=1\else%
-      \PackageError{iexec}{You must run latex with
+      \PackageError{iexec}{You must run TeX processor with
       --shell-escape option}{}%
     \fi\fi%
     \begingroup%
@@ -71,13 +90,20 @@
       \let\\\@backslashchar%
       \let\{\@charlb%
       \let\}\@charrb%
-      \ShellEscape{#2 > \iexec at stdout}%
+      \ShellEscape{#2 \ifdefined\iexec at append>\fi> \iexec at stdout}%
       \message{^^Jiexec: [#2 > \iexec at stdout]^^J}%
     \endgroup%
+    \ifdefined\iexec at log
+      \message{^^Jiexec: this is the content of \iexec at stdout:^^J}%
+      \iexec at typeout{\iexec at stdout}
+      \message{^^J<EOF>^^J}%
+    \fi%
     \ifdefined\iexec at quiet
-      \message{^^Jiexec: Due to 'quiet' we didn't read
-      the content of '\iexec at stdout'^^J}%
+      \message{^^Jiexec: Due to 'quiet' option we didn't read
+      the content of '\iexec at stdout' (\pdffilesize{} bytes)^^J}%
     \else%
+      \message{^^Jiexec: We include the content of
+        '\iexec at stdout' (\pdffilesize{} bytes)...^^J}%
       \input{\iexec at stdout}%
       \message{^^Jiexec: The content of '\iexec at stdout'
       was included into the document^^J}%



More information about the tex-live-commits mailing list.