texlive[69471] Master/texmf-dist: runcode (17jan24)

commits+karl at tug.org commits+karl at tug.org
Wed Jan 17 21:39:16 CET 2024


Revision: 69471
          https://tug.org/svn/texlive?view=revision&revision=69471
Author:   karl
Date:     2024-01-17 21:39:16 +0100 (Wed, 17 Jan 2024)
Log Message:
-----------
runcode (17jan24)

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	2024-01-17 20:39:00 UTC (rev 69470)
+++ trunk/Master/texmf-dist/doc/latex/runcode/README	2024-01-17 20:39:16 UTC (rev 69471)
@@ -1,4 +1,4 @@
-LaTeX Package: runcode 2023/09/08 v2.2
+LaTeX Package: runcode 2024/01/12 v2.3
 ----------------------------------------
 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

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	2024-01-17 20:39:00 UTC (rev 69470)
+++ trunk/Master/texmf-dist/doc/latex/runcode/runcode.tex	2024-01-17 20:39:16 UTC (rev 69471)
@@ -1,4 +1,4 @@
-% LaTeX Package: runcode 2023/09/08 v2.2
+% LaTeX Package: runcode 2024/01/12 v2.3
 % 
 % Copyright (C) 2020-2023 by Haim Bar and HaiYing Wang
 % 
@@ -49,7 +49,7 @@
 \end{abstract}
 
 \section{Installation}
-\label{sec:org6031edc}
+\label{sec:orgbc0a4bf}
 You can simply put the runcode.sty file in the \LaTeX{} project folder.
 
 The server mode requires the
@@ -65,9 +65,9 @@
 
 
 \section{Usage}
-\label{sec:org46d9194}
+\label{sec:org6167b11}
 \subsection{Load the package:}
-\label{sec:orgdf4d2a5}
+\label{sec:orgc46beda}
 \begin{minted}[]{latex}
 \usepackage[options]{runcode}
 \end{minted}
@@ -139,7 +139,7 @@
 \end{minted}
 
 \subsection{Basic commands:}
-\label{sec:org1eb4192}
+\label{sec:org9029154}
 \begin{itemize}
 \item \texttt{\textbackslash{}runExtCode\{Arg1\}\{Arg2\}\{Arg3\}[Arg4]} runs an external code.
 
@@ -223,7 +223,7 @@
 
 
 \subsection{Extended commands:}
-\label{sec:org2e715a7}
+\label{sec:orgf48d3c2}
 \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:org04ff6f1}
+\label{sec:org506ce7a}
 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:orgae938b1}
+\label{sec:orgb2671cf}
 \begin{itemize}
+\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).
 \item v2.2, September 8, 2023: add \texttt{\textbackslash{}showChunk} basic command and \texttt{\textbackslash{}runLANGChunk}
 commands for multiple languages.
 \item v2.1, June 30, 2023: detokenize code which is passed to \texttt{\textbackslash{}inln}. This is
@@ -341,7 +344,7 @@
 \end{itemize}
 
 \section{Contributing}
-\label{sec:org9eb0902}
+\label{sec:org3c84ea7}
 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	2024-01-17 20:39:00 UTC (rev 69470)
+++ trunk/Master/texmf-dist/tex/latex/runcode/runcode.sty	2024-01-17 20:39:16 UTC (rev 69471)
@@ -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}[2023/09/08 runcode v2.2]
+\ProvidesPackage{runcode}[2024/01/12 runcode v2.3]
 
 \def \langs {}
 
@@ -424,10 +424,9 @@
 \newcommand{\runcmd}[2]
 {python3 -c 'from talk2stat.talk2stat import client; client("./","#1",#2)'}
 
-% R
-% It will be used as a template for other languages
-\newcommand{\LANG}{R}
-\newcommand{\LANGcmd}{R}
+% a generic LANG - it will be used as a template for other languages
+\newcommand{\LANG}{LANG}
+\newcommand{\LANGcmd}{LANGcmd}
 
 \expandafter\NewDocumentCommand\csname run\LANG\endcsname
 {O{} m m O{}}
@@ -451,6 +450,7 @@
     {\inln{\runcmd{\LANGcmd}{"\tmpname.txt"}}{#2}[#3][#4]}
   }
   {\inln{#1}{#2}[#3][#4]}
+  \unskip\unskip\unskip
 }
 
 \expandafter\NewDocumentCommand\csname run\LANG Chunk\endcsname
@@ -459,46 +459,59 @@
   {\csname run\LANG IncOut\endcsname[#1]{\generated/#2-#3.txt}[#4][#2-#3][#6]}
 }
 
+% R
+\NewDocumentCommand{\runR}{O{} m m O{}}
+{{\renewcommand{\LANGcmd}{R}\runLANG[#1]{#2}{#3}[#4]}}
+
+\NewDocumentCommand{\runRIncOut}{O{} m O{} O{} O{vbox}}
+{{\renewcommand{\LANGcmd}{R}\runLANGIncOut[#1]{#2}[#3][#4][#5]}}
+
+\NewDocumentCommand{\inlnR}{O{} m O{} O{inline}}
+{{\renewcommand{\LANGcmd}{R}\inlnLANG[#1]{#2}[#3][#4]}}
+
+\NewDocumentCommand{\runRChunk}{O{} m m O{} O{} O{vbox}}
+{{\renewcommand{\LANGcmd}{R}\runLANGChunk[#1]{#2}{#3}[#4][#5][#6]}}
+
 % Julia
 \NewDocumentCommand{\runJulia}{O{} m m O{}}
-{\renewcommand{\LANGcmd}{julia} \runR[#1]{#2}{#3}[#4]}
+{{\renewcommand{\LANGcmd}{julia}\runLANG[#1]{#2}{#3}[#4]}}
 
 \NewDocumentCommand{\runJuliaIncOut}{O{} m O{} O{} O{vbox}}
-{\renewcommand{\LANGcmd}{julia} \runRIncOut[#1]{#2}[#3][#4][#5]}
+{{\renewcommand{\LANGcmd}{julia}\runLANGIncOut[#1]{#2}[#3][#4][#5]}}
 
 \NewDocumentCommand{\inlnJulia}{O{} m O{} O{inline}}
-{\renewcommand{\LANGcmd}{julia} \inlnR[#1]{#2}[#3][#4]}
+{{\renewcommand{\LANGcmd}{julia}\inlnLANG[#1]{#2}[#3][#4]}}
 
 \NewDocumentCommand{\runJuliaChunk}{O{} m m O{} O{} O{vbox}}
-{\renewcommand{\LANGcmd}{julia} \runRChunk[#1]{#2}{#3}[#4][#5][#6]}
+{{\renewcommand{\LANGcmd}{julia}\runLANGChunk[#1]{#2}{#3}[#4][#5][#6]}}
 
 
 % Matlab
 \NewDocumentCommand{\runMatLab}{O{} m m O{}}
-{\renewcommand{\LANGcmd}{matlab} \runR[#1]{#2}{#3}[#4]}
+{{\renewcommand{\LANGcmd}{matlab}\runLANG[#1]{#2}{#3}[#4]}}
 
 \NewDocumentCommand{\runMatLabIncOut}{O{} m O{} O{} O{vbox}}
-{\renewcommand{\LANGcmd}{matlab} \runRIncOut[#1]{#2}[#3][#4][#5]}
+{{\renewcommand{\LANGcmd}{matlab}\runLANGIncOut[#1]{#2}[#3][#4][#5]}}
 
 \NewDocumentCommand{\inlnMatLab}{O{} m O{} O{inline}}
-{\renewcommand{\LANGcmd}{matlab} \inlnR[#1]{#2}[#3][#4]}
+{{\renewcommand{\LANGcmd}{matlab}\inlnLANG[#1]{#2}[#3][#4]}}
 
 \NewDocumentCommand{\runMatLabChunk}{O{} m m O{} O{} O{vbox}}
-{\renewcommand{\LANGcmd}{matlab} \runRChunk[#1]{#2}{#3}[#4][#5][#6]}
+{{\renewcommand{\LANGcmd}{matlab}\runLANGChunk[#1]{#2}{#3}[#4][#5][#6]}}
 
 
 % Python
 \NewDocumentCommand{\runPython}{O{} m m O{}}
-{\renewcommand{\LANGcmd}{python} \runR[#1]{#2}{#3}[#4]}
+{{\renewcommand{\LANGcmd}{python}\runLANG[#1]{#2}{#3}[#4]}}
 
 \NewDocumentCommand{\runPythonIncOut}{O{} m O{} O{} O{vbox}}
-{\renewcommand{\LANGcmd}{python} \runRIncOut[#1]{#2}[#3][#4][#5]}
+{{\renewcommand{\LANGcmd}{python}\runLANGIncOut[#1]{#2}[#3][#4][#5]}}
 
 \NewDocumentCommand{\inlnPython}{O{} m O{} O{inline}}
-{\renewcommand{\LANGcmd}{python} \inlnR[#1]{#2}[#3][#4]}
+{{\renewcommand{\LANGcmd}{python}\inlnLANG[#1]{#2}[#3][#4]}}
 
 \NewDocumentCommand{\runPythonChunk}{O{} m m O{} O{} O{vbox}}
-{\renewcommand{\LANGcmd}{python} \runRChunk[#1]{#2}{#3}[#4][#5][#6]}
+{{\renewcommand{\LANGcmd}{python}\runLANGChunk[#1]{#2}{#3}[#4][#5][#6]}}
 
 
 %%%%%%%%



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