texlive[73500] Master/texmf-dist: runcode (18jan25)

commits+karl at tug.org commits+karl at tug.org
Sat Jan 18 22:03:28 CET 2025


Revision: 73500
          https://tug.org/svn/texlive?view=revision&revision=73500
Author:   karl
Date:     2025-01-18 22:03:28 +0100 (Sat, 18 Jan 2025)
Log Message:
-----------
runcode (18jan25)

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

Modified: trunk/Master/texmf-dist/doc/latex/runcode/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/runcode/README	2025-01-18 21:03:20 UTC (rev 73499)
+++ trunk/Master/texmf-dist/doc/latex/runcode/README	2025-01-18 21:03:28 UTC (rev 73500)
@@ -1,4 +1,4 @@
-LaTeX Package: runcode 2024/01/12 v2.3
+LaTeX Package: runcode 2025/01/17 v2.4
 ----------------------------------------
 The runcode package enables the execution of source code (e.g., R, 
 Julia, Matlab, shell, Python, etc.) and embed the results in the pdf file
@@ -5,7 +5,7 @@
 when compiling the LaTeX file. To use this package the shell-escape 
 option must be enabled.
 
-Copyright (C) 2020-2023
+Copyright (C) 2020-2025
 Haim Bar and HaiYing Wang https://github.com/Ossifragus/runcode
 
 Files:

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

Modified: trunk/Master/texmf-dist/doc/latex/runcode/runcode.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/runcode/runcode.tex	2025-01-18 21:03:20 UTC (rev 73499)
+++ trunk/Master/texmf-dist/doc/latex/runcode/runcode.tex	2025-01-18 21:03:28 UTC (rev 73500)
@@ -1,6 +1,6 @@
-% LaTeX Package: runcode 2024/01/12 v2.3
+% LaTeX Package: runcode 2025/01/17 v2.4
 % 
-% Copyright (C) 2020-2023 by Haim Bar and HaiYing Wang
+% Copyright (C) 2020-2025 by Haim Bar and HaiYing Wang
 % 
 % This file may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either
@@ -49,15 +49,15 @@
 \end{abstract}
 
 \section{Installation}
-\label{sec:orgbc0a4bf}
+\label{sec:org7b41ef7}
 You can simply put the runcode.sty file in the \LaTeX{} project folder.
 
-The server mode requires the
-\href{https://pypi.org/project/talk2stat/}{talk2stat} package. To install
-it from the command line, use:
+The server mode requires the \href{https://pypi.org/project/talk2stat/}{talk2stat} package, and some chunk command (e.g.,
+\texttt{\textbackslash{}showChunk}) requires the \href{https://pypi.org/project/advance-touch/}{advance-touch} package. To install them from the
+command line, use:
 
 \begin{verbatim}
-pip3 install talk2stat
+pip3 install talk2stat advance-touch
 \end{verbatim}
 
 \textbf{Note}: \texttt{runcode} requires to enable the \texttt{shell-escape} option when
@@ -65,9 +65,9 @@
 
 
 \section{Usage}
-\label{sec:org6167b11}
+\label{sec:org5034faf}
 \subsection{Load the package:}
-\label{sec:orgc46beda}
+\label{sec:orge3286de}
 \begin{minted}[]{latex}
 \usepackage[options]{runcode}
 \end{minted}
@@ -139,7 +139,7 @@
 \end{minted}
 
 \subsection{Basic commands:}
-\label{sec:org9029154}
+\label{sec:org496679c}
 \begin{itemize}
 \item \texttt{\textbackslash{}runExtCode\{Arg1\}\{Arg2\}\{Arg3\}[Arg4]} runs an external code.
 
@@ -223,7 +223,7 @@
 
 
 \subsection{Extended commands:}
-\label{sec:orgf48d3c2}
+\label{sec:orgf1638ce}
 \begin{itemize}
 \item \texttt{\textbackslash{}runCodeIncOut\{Arg1\}\{Arg2\}[Arg3][Arg4][Arg5]} runs an external code and
 embeds the output. This is a combination of \texttt{\textbackslash{}runExtCode} and \texttt{\textbackslash{}includeOutput}.
@@ -240,7 +240,7 @@
 \end{itemize}
 
 \subsection{Language specific shortcuts:}
-\label{sec:org506ce7a}
+\label{sec:org8195ea0}
 Replace \texttt{LANG} with \texttt{Julia}, \texttt{MatLab}, \texttt{Python}, or \texttt{R}, for the \href{https://julialang.org/}{Julia}, \href{https://www.mathworks.com/products/matlab.html}{MatLab}, \href{https://www.python.org/}{Python}, \href{https://www.r-project.org/}{R}
 language, respectively, for the following commands.
 
@@ -305,8 +305,11 @@
 
 
 \section{Revisions}
-\label{sec:orgb2671cf}
+\label{sec:orge3b69ca}
 \begin{itemize}
+\item v2.4, January 17, 2025: 1. put file names within \$\$ for more robust
+warnings; 2. use the python \href{https://pypi.org/project/advance-touch/}{advance-touch} package to create sub-folders for
+chunk related commands.
 \item v2.3, January 12, 2024: two bug fixes (1. removed an extra space after
 \texttt{\textbackslash{}inlnX}; 2. when an underscore appeared inside R code, the tex file would
 compile with an error).
@@ -344,7 +347,7 @@
 \end{itemize}
 
 \section{Contributing}
-\label{sec:org3c84ea7}
+\label{sec:orged22cfb}
 We welcome your contributions to this package by opening issues on
 GitHub and/or making a pull request. We also appreciate more example
 documents written using \texttt{runcode}.

Modified: trunk/Master/texmf-dist/tex/latex/runcode/runcode.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/runcode/runcode.sty	2025-01-18 21:03:20 UTC (rev 73499)
+++ trunk/Master/texmf-dist/tex/latex/runcode/runcode.sty	2025-01-18 21:03:28 UTC (rev 73500)
@@ -4,7 +4,7 @@
 %
 %  This package is based on an ongoing work by Haim Bar and HaiYing Wang, and comments and questions are welcome!
 
-\ProvidesPackage{runcode}[2024/01/12 runcode v2.3]
+\ProvidesPackage{runcode}[2025/01/17 runcode v2.4]
 
 \def \langs {}
 
@@ -222,7 +222,7 @@
     \fi
   } 
   }{
-    \textcolor{red}{\textbf{showCode: File #2 does not exist!}}
+    \textcolor{red}{\textbf{showCode: File $#2$ does not exist!}}
   }
 
 }
@@ -289,7 +289,7 @@
       {\input{\tmpname}}}}
   % if code execution disabled, and no cache:
   {\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black]
-      \textbf{Output file \tmpname~ not found}. Check the file name (it may be that the file name was given with the suffix .tex. If so, remove it). If the file name is correct the problem may be because code execution is disabled and no cache is available. If so, force the code to run again (using the [run] option).
+      \textbf{Output file $\tmpname~$ not found}. Check the file name (it may be that the file name was given with the suffix .tex. If so, remove it). If the file name is correct the problem may be because code execution is disabled and no cache is available. If so, force the code to run again (using the [run] option).
     \end{tcolorbox}}}
 
 
@@ -328,15 +328,15 @@
     \immediate\closeout\outfile
     \endlinechar=13
     \ifnum\printcode=0
-      \textcolor{red}{\textbf{Label #2 not found in #1}}
+      \textcolor{red}{\textbf{Label $#2$ not found in #1}}
     \fi
-  }{\textcolor{red}{\textbf{Source file #1 not found}}}
+  }{\textcolor{red}{\textbf{Source file $#1$ not found}}}
 }
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 % \showChunk prints a selected chunk from  source code, using minted or listings for a pretty layout.
 % The chunk is identified in the source code by two strings that define the beginning and end of the chunk.
-% The default beginning is label===<name> where <name> should be a unique user-defined chunk ID.
+% The default beginning is label===<name> where <name> should be a unique user-defined chunk ID. A label cannot include foreward slash (/)
 % The default end marker is ===end
 % In the code, these markers should appear after a comment character, so that the code will run. 
 % Arg #1 is the programming language,
@@ -346,10 +346,11 @@
 
 \NewDocumentCommand{\showChunk}{m m m O{label===} O{===end}}{
   \IfFileExists{#2}{
+    \immediate\write18{ad \generated/#2-#3.txt}
     \writeChunk{#2}{#3}[#4][#5]
     \IfFileExists{\generated/#2-#3.txt}{\showCode{#1}{\generated/#2-#3.txt}}
-    {\textcolor{red}{\textbf{Label #3 not found in #2}}}
-  }{\textcolor{red}{\textbf{Source file #2 not found}}}
+    {\textcolor{red}{\textbf{Label $#3$ not found in #2}}}
+  }{\textcolor{red}{\textbf{Source file $#2$ not found}}}
 }
 
 
@@ -397,7 +398,7 @@
         \fi
       \end{tcolorbox}}
     {\unskip{\input{\tmpname.tex}}\unskip}}
-    {\textcolor{red}{\textbf{Output file \tmpname~ not found}}}}
+    {\textcolor{red}{\textbf{Output file $\tmpname~$ not found}}}}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % Extended and language-specific commands:
@@ -551,7 +552,7 @@
      }
      {
         \immediate\write18{cat /dev/null > \tmpname}
-        \textcolor{red}{\textbf{runPythonBatch: File #1 does not exist!}}
+        \textcolor{red}{\textbf{runPythonBatch: File $#1$ does not exist!}}
      }
 }
 



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