texlive[68842] Master/texmf-dist: robust-externalize (14nov23)

commits+karl at tug.org commits+karl at tug.org
Tue Nov 14 22:04:24 CET 2023


Revision: 68842
          https://tug.org/svn/texlive?view=revision&revision=68842
Author:   karl
Date:     2023-11-14 22:04:24 +0100 (Tue, 14 Nov 2023)
Log Message:
-----------
robust-externalize (14nov23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/robust-externalize/robust-externalize.pdf
    trunk/Master/texmf-dist/doc/latex/robust-externalize/robust-externalize.tex
    trunk/Master/texmf-dist/tex/latex/robust-externalize/robust-externalize.sty

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

Modified: trunk/Master/texmf-dist/doc/latex/robust-externalize/robust-externalize.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/robust-externalize/robust-externalize.tex	2023-11-14 21:04:10 UTC (rev 68841)
+++ trunk/Master/texmf-dist/doc/latex/robust-externalize/robust-externalize.tex	2023-11-14 21:04:24 UTC (rev 68842)
@@ -94,7 +94,7 @@
   {\Large\bfseries Cache anything (\tikzname, tikz-cd, python…),\\in a robust, efficient and pure way.}
 
   \vspace{1em}
-  {Léo Colisson \quad Version 2.1}\\[3mm]
+  {Léo Colisson \quad Version 2.2}\\[3mm]
   {\href{https://github.com/leo-colisson/robust-externalize}{\texttt{github.com/leo-colisson/robust-externalize}}}
 \end{center}
 
@@ -118,7 +118,7 @@
   enable fallback to manual mode,
 }
 \end{verbatim}
-Then type something like this (note the |C| for |cached| at the end of |tikzpictureC|, see below to override the original command), and compile with |pdflatex -shell-escape yourfile.tex| (or \textcolor{red}{\textbf{read below if you do not want to use }}|-shell-escape|):
+Then type something like this (note the |C| for |cached| at the end of |tikzpictureC|, see below to override the original command), and compile with |pdflatex -shell-escape yourfile.tex| (or \textcolor{red}{\textbf{read below if you do not want to use }}|-shell-escape|\textcolor{red}{\textbf{ (note that overleaf enables shell-escape by default, and it not needed once all pictures are cached)}}):
 \begin{codeexample}[width=0pt,vbox]
   \robExtConfigure{
     add to preset={tikz}{
@@ -2794,7 +2794,7 @@
   \node[fill=myviolet,yshift=-1cm]{B};
 \end{tikzpictureC}
 \end{codeexample}
-Note that using |if matches|, you can also automatically forward colors:
+Note that using |if matches word|, you can also automatically forward colors:
 \begin{codeexample}[width=0pt]
 \definecolor{myred}{HTML}{F01122}
 \colorlet{myviolet}{blue!50!myred}
@@ -2801,7 +2801,7 @@
 \colorlet{mypink}{pink!90!orange}
 \robExtConfigure{
   add to preset={tikz}{
-    if matches={mypink}{forward color=mypink},
+    if matches word={mypink}{forward color=mypink},
   },
 }
 \begin{tikzpictureC}
@@ -2846,6 +2846,7 @@
   \MyGreenNode[xshift=8cm]{but not if the (unused) MyNode is changed.}
 \end{tikzpicture}
 \end{codeexample}
+
 \end{pgfmanualentry}
 
 \begin{pgfmanualentry}
@@ -2872,7 +2873,13 @@
   \extractcommand\RenewDocumentCommandAutoForward\marg{macro}\marg{arg spec}\opt{\oarg{additional style}}\marg{definition}\@@
   \extractcommand\ProvideDocumentCommandAutoForward\marg{macro}\marg{arg spec}\opt{\oarg{additional style}}\marg{definition}\@@
   \extractcommand\DeclareDocumentCommandAutoForward\marg{macro}\marg{arg spec}\opt{\oarg{additional style}}\marg{definition}\@@
+  \extractcommand\NewExpandableDocumentCommandAutoForward\marg{macro}\marg{arg spec}\opt{\oarg{additional style}}\marg{definition}\@@
+  \extractcommand\RenewExpandableDocumentCommandAutoForward\marg{macro}\marg{arg spec}\opt{\oarg{additional style}}\marg{definition}\@@
+  \extractcommand\ProvideExpandableDocumentCommandAutoForward\marg{macro}\marg{arg spec}\opt{\oarg{additional style}}\marg{definition}\@@
+  \extractcommand\DeclareExpandableDocumentCommandAutoForward\marg{macro}\marg{arg spec}\opt{\oarg{additional style}}\marg{definition}\@@
   \extractcommand\defAutoForward\marg{macro}\opt{\oarg{def-style arg spec}}\marg{macro}\opt{\oarg{additional style}}\@@
+  \extractcommand\genericAutoForward\opt{*}\opt{\oarg{preset}}\marg{string to match}\opt{\oarg{additional style}}\marg{code to execute}\@@
+  \extractcommand\genericAutoForwardStringMatch\opt{*}\opt{\oarg{preset}}\marg{string to match}\opt{\oarg{additional style in preset}}\opt{\oarg{additional style outside preset}}\marg{code to execute}\@@
   \pgfmanualbody
 \begin{verbatim}
 \newcommandAutoForward{\macro}[nb args][default value]{def}[STYLE]
@@ -2885,7 +2892,57 @@
 \begin{verbatim}
 \configIfMacroPresent{\macro}{forward=\macro,STYLE}
 \end{verbatim}
-  to automatically forward the macro if it is used. This works similarly for other commands (note that for |\defAutoForward|, you need to put the arguments in a bracket, like |\defAutoForward\myMacro[#1 and #2]{Hey #1, #2}| for |\def\myMacro#1 and #2{Hey #1, #2}|).
+  to automatically forward the macro if it is used. It is really practical to automatically define a macro and forward it:
+\begin{codeexample}[vbox]
+\cacheTikz  
+\robExtConfigure{add to preset={tikz}{auto forward}}
+
+\newcommandAutoForward{\MyName}{\ding{164} Alice}[add to preamble={\usepackage{pifont}}]
+\newcommandAutoForward{\MyNode}[2][draw,thick]{\node[rounded corners,fill=green,#1]{\MyName: #2};}[
+  load auto forward macro config=\MyName
+]
+
+\begin{tikzpicture}
+  \MyNode{Recompiled only if MyNode is changed}
+  \MyNode[yshift=-1cm]{or if MyName is changed}
+\end{tikzpicture}
+\end{codeexample}
+
+  This works similarly for other commands (note that for |\defAutoForward|, you need to put the arguments in a bracket, like |\defAutoForward\myMacro[#1 and #2]{Hey #1, #2}| for |\def\myMacro#1 and #2{Hey #1, #2}|). |\genericAutoForward| and |\genericAutoForwardStringMatch| are a bit special (for now these two commands are alias, but only use the first one if the string is surrounded by non-letter characters as we plan to make that special case more efficient later as it uses internally |if matches word|), as it can be used to run any code assuming that |string to match| is present. For instance, you can use it to automatically forward the code that defines a new tikz style assuming |mystyle| is preset:
+\begin{codeexample}[width=0pt]
+\cacheTikz
+\genericAutoForward{mystyle}{
+  \tikzset{mystyle/.style={fill=#1!10!white,text=#1!50!black}}
+}
+
+\begin{tikzpicture}
+  \node[mystyle=green]{A};
+\end{tikzpicture}    
+\end{codeexample}
+This will also run the code to define it in the current document (practical for instance if some pictures are not externalized), use the stared version of |\genericAutoForward| if you do not want to run the code in the current document. By default, the code is added to the |latex| preset, but you can choose another preset if you want using the optional option. The additional style might be specified to run other style if the matches is true. Note that you should be able to use definitions inside the code (a bug in v2.1 was making this code fail):
+\begin{codeexample}[width=0pt]
+\genericAutoForward{mystyle}{
+  \tikzset{mystyle/.style={fill=#1!10!white,text=#1!50!black}}
+}
+\newcommandAutoForward{\myName}{Alice}
+\robExtConfigure{
+  add to preset={tikz}{
+    auto forward, % not needed for genericAutoForward, but for newcommandAutoForward
+    if matches word={pmatrix}{add to preamble={\usepackage{amsmath}}}
+  }
+}
+
+\begin{tikzpicture}
+  \node[mystyle=green]{%
+    \def\hey#1{Hey #1 :)}% You can define macros inside the cached elements
+    \hey{Coucou \myName} %
+    $\begin{pmatrix}% Fixing a bug introduced in v2.1, we can also use macros
+      A & B\\
+      C & D\\
+    \end{pmatrix}$
+  };
+\end{tikzpicture}
+\end{codeexample}
 \end{pgfmanualentry}
 
 \begin{pgfmanualentry}
@@ -2915,10 +2972,11 @@
   \makeatletter%
   \def\extrakeytext{style, }
   \extractkey/robExt/if matches=\marg{string}\marg{style to apply}\@nil
+  \extractkey/robExt/if matches word=\marg{string}\marg{style to apply}\@nil
   \extractkey/robExt/if matches regex=\marg{latex3 regex}\marg{style to apply}\@nil
   \makeatother%
   \pgfmanualbody
-  Apply the corresponding style if the string (resp.\ regex in \LaTeX{}3 format) matches is matched in the content. The regex version can be more expressive, but is wayyy slower.
+  Apply the corresponding style if the string (resp.\ regex in \LaTeX{}3 format) matches is matched in the content. As of today, |if matches word| and |if matches| are equivalent, but I plan to make |if watches word| more efficient\footnote{Scaling with $O(s)$ instead of $O(sn)$, where $s$ is the size of the string typed in |cacheMe| and $n$ is the number of times |if matches| is used, for instance when replacing multiple strings.}, and make it only match words that are made of consecutive letters |[A-Za-z]|. The regex version can be more expressive, but is significantly slower (it can easily multiply by 2 the compilation time).
 \begin{codeexample}[vbox]
 \robExtConfigure{
   add to preset={my python}{
@@ -3014,7 +3072,7 @@
   compile in parallel
 }
 \end{codeexample}
-will cause the cached elements to be compiled in parallel (this requires two compilations of the main project). For this to work out of the box, you need to have GNU |parallel| installed (on linux or Mac) or rush (\url{https://github.com/shenwei356/rush/}) on Windows. Typing |compile in parallel after=3| will start the compilation in parallel only if you have more than 3 new elements to compile, and compile the first 3 elements normally (useful when you work on one picture at a time since you do not need to compile twice the document).
+will cause the cached elements to be compiled in parallel (this requires two compilations of the main project). For this to work out of the box, you need to have |xargs| installed (on windows, install the lightweight GNU On Windows (Gow) \url{https://github.com/bmatzelle/gow} to get |xargs|). Typing |compile in parallel after=3| will start the compilation in parallel only if you have more than 3 new elements to compile, and compile the first 3 elements normally (useful when you work on one picture at a time since you do not need to compile twice the document).
 \end{pgfmanualentry}
 
 \begin{pgfmanualentry}
@@ -3023,7 +3081,6 @@
   \extractkey/robExt/compile in parallel command=\marg{command to run}\@nil
   \extractkey/robExt/compile in parallel with xargs=\opt{number threads} (default 16\%)\@nil
   \extractkey/robExt/compile in parallel with gnu parallel=\opt{--jobs option} (default 200\%)\@nil
-  \extractkey/robExt/compile in parallel with rush=\opt{additional options} (default )\@nil
   \makeatother%
   \pgfmanualbody
   You can customize the compilation command to run via something like:
@@ -3034,7 +3091,7 @@
   },
 }
 \end{codeexample}
-The other styles are predefined commands to compile with xargs (by default, already installed in linux, on Windows you can get it by installing the lightweight GNU On Windows (Gow) \url{https://github.com/bmatzelle/gow}), gnu parallel, or rush (\url{https://github.com/shenwei356/rush/}). You can use these commands directly like:
+The other styles are predefined commands to compile with xargs (by default, already installed in linux, on Windows you can get it by installing the lightweight GNU On Windows (Gow) \url{https://github.com/bmatzelle/gow}) or gnu parallel. You can use these commands directly like:
 \begin{codeexample}[code only]
 \robExtConfigure{
   compile in parallel with gnu parallel
@@ -3048,6 +3105,24 @@
 \end{codeexample}
 \end{pgfmanualentry}
 
+\begin{pgfmanualentry}
+  \makeatletter%
+  \def\extrakeytext{style, }
+  \extractkey/robExt/if unix=\marg{style to run if running linux or unix}\@nil
+  \extractkey/robExt/if windows=\marg{style to run if windows}\@nil
+  \makeatother%
+  \pgfmanualbody
+  Since windows does not pack |xparse| by default, you might want to enable parallel compilation only in Linux/MacOs. This can be done using the above flags, like:
+\begin{codeexample}[code only]
+\robExtConfigure{
+  if unix={
+    compile in parallel
+  },
+}
+\end{codeexample}
+(note that |unix| is understood as ``non windows'', i.e.\ would run in Unix/Linux/MacOs)
+\end{pgfmanualentry}
+
 NB: in version smaller than v2.1 (or if you prefer the manual method), you can instead run it in manual mode and use for instance GNU |parallel| (or any tool of you choice) to run all commands in the file |\jobname-robExt-compile-missing-figures.sh| in parallel. To do that:
 \begin{itemize}
 \item First add |\robExtConfigure{enable manual mode}| in your file
@@ -3948,7 +4023,9 @@
 \begin{itemize}
 \item See how to deal with label, links and cite inside pictures (without disabling externalization). For label and links, I have a proof of concept, I ``just'' need to write it down. \url{https://tex.stackexchange.com/questions/695277/clickable-includegraphics-for-cross-reference-data}
 \item Deal with remember picture
-\item Since externalizing is all about speed, it would be nice to do more benchmarks.
+\item Since externalizing is all about speed, it would be nice to do more benchmarks. But overall, it seems fairly optimized, at least when using the compiled presets.
+\item Add a way to forward tikz styles and/or arbitrary code.
+\item Create a more efficient/precise way to check if a word is present than string ``is in''. Indeed, for now for each color/... to export, we check if the string contains this word, which scales like $O(sn)$ where $s$ is the size of the string and $n$ is the number of colors etc to export. Instead, I'd like to run it in $O(s)$ by extracting all words a single time, and then checking if this word exists or not. This is not an issue for |\newcommandAutoforward|, but could be an issue when exporting many colors or |\genericAutoForward|.
 \end{itemize}
 
 \section{Acknowledgments}
@@ -3958,8 +4035,18 @@
 \section{Changelog}
 
 \begin{itemize}
-\item future v2.1 (master on github, not released yet on CTAN):
+\item Future v2.3 (master on github, not released yet on CTAN):
+\item v2.2 
   \begin{itemize}
+  \item v2.1 introduced two important bugs where hashes could not be used in a |\cacheMe| environment, and |auto forward| was not working if the string was containing an environment. This is fixed now.
+  \item Fix issue with |compile in parallel| on MacOs (xargs there is not GNU xargs and is missing |-a| option)
+  \item Added |*ExpandableDocumentCommandAutoForward|.
+  \item Added |\genericAutoForward| to forward arbitrary code.
+  \item Added |if windows| and |if unix| tests.
+  \item Added details on the future difference between |if matches| and |if matches word|.
+  \end{itemize}
+\item v2.1:
+  \begin{itemize}
   \item Fix a bug when compiling the main document with lualatex or xelatex
   \item Fix a bug when compiling a template that was not exporting dependencies
   \item Add |recompile| to recompile a file even if no dependencies changed.

Modified: trunk/Master/texmf-dist/tex/latex/robust-externalize/robust-externalize.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/robust-externalize/robust-externalize.sty	2023-11-14 21:04:10 UTC (rev 68841)
+++ trunk/Master/texmf-dist/tex/latex/robust-externalize/robust-externalize.sty	2023-11-14 21:04:24 UTC (rev 68842)
@@ -1,4 +1,4 @@
-\ProvidesPackage{robust-externalize}[2.1 Cache anything (tikz, latex, python) in a robust, efficient and pure way.]
+\ProvidesPackage{robust-externalize}[2.2 Cache anything (tikz, latex, python) in a robust, efficient and pure way.]
 % todo: 
 % change order argument replace from list, it is hard to read this way
 
@@ -20,6 +20,11 @@
 %%%%%%%%%%% Utils %%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
+\ExplSyntaxOn
+\NewDocumentCommand{\robExtIfWindowsTF}{mm}{%
+  \sys_if_platform_windows:TF {#1}{#2}%
+}
+\ExplSyntaxOff
 
 % Debug function: by default, do nothing
 \def\robExtDebugMessage#1{}
@@ -81,6 +86,8 @@
 \cs_generate_variant:Nn \robExt_set_hash_robust:Nn { cn }
 \cs_generate_variant:Nn \robExt_set_hash_robust:Nn { cx }
 
+\NewDocumentCommand{\robExt at set@hash at robust}{mm}{\robExt_set_hash_robust:Nn #1 {#2}}
+
 % Double the number of hashes... quite dirty but cannot find any solution or the user need to double it itself
 %% See also https://tex.stackexchange.com/questions/695432/latex3-latex-doubles-the-number-of-hashes-when-storing-them-in-string/695460#695460
 \NewDocumentCommand{\robExtStrSetDoubleHash}{mm}{
@@ -1658,11 +1665,11 @@
     \tl_set_rescan:NnV \robExtUserInputCacheMe {} \l__robExt_placeholder___ROBEXT_MAIN_CONTENT_ORIG___str
   \fi
   \robExt at normalBraces\robExtUserInputCacheMe
-  \expandafter\robExt at getfromstringA\robExtUserInputCacheMe\end
+  \expandafter\robExt at getfromstringA\robExtUserInputCacheMe\robExt at getfromstringA%\robExt at getfromstringA is added to know when to stop
 }
 
 % https://tex.stackexchange.com/questions/700834/efficiently-program-search-of-macro-in-string/700844
-\def\robExt at getfromstringA#1{\ifx#1\end \else
+\def\robExt at getfromstringA#1{\ifx#1\robExt at getfromstringA \else
   %\ifcsname L:\string#1\endcsname \addto\listmacros{#1}\fi
   \robExtLoadAutoForwardMacroConfig{#1}%
   \expandafter\robExt at getfromstringA\fi
@@ -1746,11 +1753,78 @@
   \robExtAutoForwardMacro{#1}[#3]
 }
 
+\NewDocumentCommand{\NewExpandableDocumentCommandAutoForward}{mmO{}m}{
+  \NewExpandableDocumentCommand{#1}{#2}{#4}
+  \robExtAutoForwardMacro{#1}[#3]
+}
+
+\NewDocumentCommand{\RenewExpandableDocumentCommandAutoForward}{mmO{}m}{
+  \RenewExpandableDocumentCommand{#1}{#2}{#4}
+  \robExtAutoForwardMacro{#1}[#3]
+}
+
+\NewDocumentCommand{\ProvideExpandableDocumentCommandAutoForward}{mmO{}m}{
+  \ProvideExpandableDocumentCommand{#1}{#2}{#4}
+  \robExtAutoForwardMacro{#1}[#3]
+}
+
+\NewDocumentCommand{\DeclareExpandableDocumentCommandAutoForward}{mmO{}m}{
+  \DeclareExpandableDocumentCommand{#1}{#2}{#4}
+  \robExtAutoForwardMacro{#1}[#3]
+}
+
 \NewDocumentCommand{\defAutoForward}{mO{}mO{}}{
   \def#1#2{#3}
   \robExtAutoForwardMacro{#1}[#4]
 }
 
+% \robExtGenericAutoForward[tikz]{string to match}[additional style to run]{
+%    code to run in cached file if string matches, and to always run in current folder if not using
+%    the star version
+%  }
+\ExplSyntaxOff
+\NewDocumentCommand{\robExtGenericAutoForward}{sO{latex}mO{}m}{%
+  \IfBooleanTF{#1}{}{#5}% We run the code right now
+  \robExt at set@hash at robust\zxTmpMacro{#5}%
+  \robExtConfigure{%
+    add to preset={#2}{%
+      if matches word={#3}{
+        command if externalization/.append code={
+          \expanded{%
+            \noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
+              \expandonce{\zxTmpMacro}%
+              % #1%%
+            }%
+          }%
+        },#4%
+      }%
+    }%
+  }%
+}
+\let\genericAutoForward\robExtGenericAutoForward
+
+% uses "if matches" instead of "if matches word"
+\NewDocumentCommand{\robExtGenericAutoForwardStringMatch}{sO{latex}mO{}m}{%
+  \IfBooleanTF{#1}{}{#5}% We run the code right now
+  \robExt at set@hash at robust\zxTmpMacro{#5}%
+  \robExtConfigure{%
+    add to preset={#2}{%
+      if matches={#3}{
+        command if externalization/.append code={
+          \expanded{%
+            \noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
+              \expandonce{\zxTmpMacro}%
+              % #1%%
+            }%
+          }%
+        },#4%
+      }%
+    }%
+  }%
+}
+\let\genericAutoForwardStringMatch\robExtGenericAutoForwardStringMatch
+\ExplSyntaxOn
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%% Automatically forward (regex-based)
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2119,6 +2193,25 @@
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   command if externalization/.code={},
   fw/.style={forward=#1},
+  run code before main content if externalization enabled/.code={\message{#1}},
+  % run code before main content if externalization enabled/.code={
+  %   \message{aaa #1}
+  %   \def\zx at tmp{#1}%
+  %   \message{xxx}
+  %   \show\zx at tmp%
+  %   \scantokens{%
+  %     \pgfkeysalso{
+  %       command if externalization/.append code={%
+  %         \expanded{%
+  %           \noexpand\robExtAddBeforePlaceholder*{__ROBEXT_MAIN_CONTENT__}{%
+  %             % \expandonce{\zx at tmp}%
+  %             #1%%
+  %           }%
+  %         }%
+  %       }%
+  %     }%
+  %   },
+  % },
   forward/.style={%
     command if externalization/.append code={%
       \robExtGetCommandDefinitionInMacro{#1}%
@@ -2186,6 +2279,7 @@
   load auto forward macro config/.code={\robExtLoadAutoForwardMacroConfig{#1}},
   %% This will
   if matches regex/.code 2 args={\robExtIfMatchesRegex{#1}{#2}},
+  if matches word/.code 2 args={\robExtIfMatchesString{#1}{#2}},
   if matches/.code 2 args={\robExtIfMatchesString{#1}{#2}},
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   %%% Run code before/after inclusion %%%
@@ -2216,6 +2310,13 @@
     \gdef\robExt at compile@parallel at after{#1}%
   },
   compile in parallel after/.default=0,
+  disable compile in parallel/.code={\let\robExt at compile@parallel at after\undefined},
+  if windows/.code={%
+    \robExtIfWindowsTF{\pgfkeysalso{zx at tmp@key/.estyle={\unexpanded{#1}},zx at tmp@key}}{}%
+  },
+  if unix/.code={%
+    \robExtIfWindowsTF{}{\pgfkeysalso{zx at tmp@key/.estyle={\unexpanded{#1}},zx at tmp@key}}%
+  },
   compile in parallel command/.store in=\robExt at compile@parallel at command,
   % Different backends to compile in parallel
   compile in parallel with gnu parallel/.style={
@@ -2223,15 +2324,14 @@
   },
   compile in parallel with gnu parallel/.default={200\%},
   compile in parallel with xargs/.style={
-    compile in parallel command={xargs -t -a '\jobname-\robExtAddPrefixName{compile-missing-figures.sh}' -I "{}" -P #1 \robExtParallelShell\space '{}'},
+    % Use " instead of ' as Windows does not consider ' as a valid surrounding for strings
+    compile in parallel command={xargs -t -I "{}" -P #1 \robExtParallelShell\space "{}" < "\jobname-\robExtAddPrefixName{compile-missing-figures.sh}"},
   },
+  % With 0 it spawns as many shells at possible, i.e. it compiles all 200 pictures at the same time, making the
+  % system a laggy, and it is actually *slower* (2:05mn vs 1:15mn) than when using 16 threads.
   compile in parallel with xargs/.default={16},
   % By default, we compile with xargs and 16 processes:
   compile in parallel with xargs,
-  compile in parallel with rush/.style={
-    compile in parallel command={rush -i "\jobname-\robExtAddPrefixName{compile-missing-figures.sh}" #1 "\robExtParallelShell\space '{}'"},
-  },
-  compile in parallel with rush/.default={},
 }
 
 \ExplSyntaxOn
@@ -2309,7 +2409,7 @@
 \NewDocumentCommand{\robExtCacheMe}{O{}m}{%
   {% Group
     %% We store the input in a non-string element for efficiently implementing "auto forward"
-    \def\robExtUserInputCacheMe{#2}
+    \edef\robExtUserInputCacheMe{\unexpanded{#2}}% \unexpanded is needed if the macro contains a #1
     \pgfkeys{%
       /robExt/.cd,%
       set placeholder={__ROBEXT_MAIN_CONTENT_ORIG__}{#2},%



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