texlive[67367] Master/texmf-dist: runcode (14jun23)
commits+karl at tug.org
commits+karl at tug.org
Wed Jun 14 22:14:27 CEST 2023
Revision: 67367
http://tug.org/svn/texlive?view=revision&revision=67367
Author: karl
Date: 2023-06-14 22:14:27 +0200 (Wed, 14 Jun 2023)
Log Message:
-----------
runcode (14jun23)
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 2023-06-14 20:14:16 UTC (rev 67366)
+++ trunk/Master/texmf-dist/doc/latex/runcode/README 2023-06-14 20:14:27 UTC (rev 67367)
@@ -1,4 +1,4 @@
-LaTeX Package: runcode 2023/01/18 v1.8
+LaTeX Package: runcode 2023/06/13 v1.9
----------------------------------------
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 2023-06-14 20:14:16 UTC (rev 67366)
+++ trunk/Master/texmf-dist/doc/latex/runcode/runcode.tex 2023-06-14 20:14:27 UTC (rev 67367)
@@ -1,4 +1,4 @@
-% LaTeX Package: runcode 2023/01/18 v1.8
+% LaTeX Package: runcode 2023/06/13 v1.9
%
% Copyright (C) 2020-2022 by Haim Bar and HaiYing Wang
%
@@ -49,7 +49,7 @@
\end{abstract}
\section{Installation}
-\label{sec:org1037dff}
+\label{sec:org8c6be84}
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:org325e4fc}
+\label{sec:org951dfd0}
\subsection{Load the package:}
-\label{sec:orgbccebff}
+\label{sec:org516e8f6}
\begin{minted}[]{latex}
\usepackage[options]{runcode}
\end{minted}
@@ -139,7 +139,7 @@
\end{minted}
\subsection{Basic commands:}
-\label{sec:org88340c8}
+\label{sec:org917f9dc}
\begin{itemize}
\item \texttt{\textbackslash{}runExtCode\{Arg1\}\{Arg2\}\{Arg3\}[Arg4]} runs an external code.
@@ -182,7 +182,7 @@
\end{itemize}
\end{itemize}
-\item \texttt{\textbackslash{}inln\{Arg1\}\{Arg2\}[Arg3]} is designed for simple calculations; it runs
+\item \texttt{\textbackslash{}inln\{Arg1\}\{Arg2\}[Arg3][Arg4]} is designed for simple calculations; it runs
one command (or a short batch) and displays the output within the
text.
@@ -189,7 +189,8 @@
\begin{itemize}
\item \texttt{Arg1} is the executable program or programming language.
\item \texttt{Arg2} is the source code.
-\item \texttt{Arg3} is the output type.
+\item \texttt{Arg3} is the output file name (optional);
+\item \texttt{Arg4} is the output type.
\begin{itemize}
\item \texttt{inline} (or skipped or with empty value) = embed result in text.
\item \texttt{vbox} = verbatim in a box.
@@ -198,7 +199,7 @@
\end{itemize}
\subsection{Language specific shortcuts:}
-\label{sec:org591e87e}
+\label{sec:org7b04bad}
\href{https://julialang.org/}{Julia}
\begin{itemize}
@@ -211,7 +212,7 @@
\item \texttt{Arg2}, \texttt{Arg3}, and \texttt{Arg4} have the same effects as those of the
basic command \texttt{\textbackslash{}runExtCode}.
\end{itemize}
-\item \texttt{\textbackslash{}inlnJulia[Arg1]\{Arg2\}[Arg3]} runs \href{https://julialang.org/}{Julia}
+\item \texttt{\textbackslash{}inlnJulia[Arg1]\{Arg2\}[Arg3][Arg4]} runs \href{https://julialang.org/}{Julia}
source code (\texttt{Arg2}) and displays the output in line.
\begin{itemize}
\item \texttt{Arg1} is optional and uses the \href{https://julialang.org/}{Julia}
@@ -221,7 +222,7 @@
between "\texttt{```}" on both sides (as in the markdown grammar), then it
will be implemented directly; otherwise the code will be written to
a file on the disk and then be called.
-\item \texttt{Arg3} has the same effect as that of the basic command \texttt{\textbackslash{}inln}.
+\item \texttt{Arg3} and \texttt{Arg4} have the same effects as those of the basic command \texttt{\textbackslash{}inln}.
\end{itemize}
\end{itemize}
@@ -238,7 +239,7 @@
\item \texttt{Arg2}, \texttt{Arg3}, and \texttt{Arg4} have the same effects as those of the
basic command \texttt{\textbackslash{}runExtCode}.
\end{itemize}
-\item \texttt{\textbackslash{}inlnMatLab[Arg1]\{Arg2\}[Arg3]} runs
+\item \texttt{\textbackslash{}inlnMatLab[Arg1]\{Arg2\}[Arg3][Arg4]} runs
\href{https://www.mathworks.com/products/matlab.html}{MatLab} source code
(\texttt{Arg2}) and displays the output in line.
\begin{itemize}
@@ -252,7 +253,7 @@
code is wrapped between "```" on both sides (as in the markdown
grammar), then it will be implemented directly; otherwise the code
will be written to a file on the disk and then be called.
-\item \texttt{Arg3} has the same effect as that of the basic command \texttt{\textbackslash{}inln}.
+\item \texttt{Arg3} and \texttt{Arg4} have the same effects as those of the basic command \texttt{\textbackslash{}inln}.
\end{itemize}
\end{itemize}
@@ -268,7 +269,7 @@
\item \texttt{Arg2}, \texttt{Arg3}, and \texttt{Arg4} have the same effects as those of the
basic command \texttt{\textbackslash{}runExtCode}.
\end{itemize}
-\item \texttt{\textbackslash{}inlnPython[Arg1]\{Arg2\}[Arg3]} runs
+\item \texttt{\textbackslash{}inlnPython[Arg1]\{Arg2\}[Arg3][Arg4]} runs
\href{https://www.python.org/}{Python} source code (\texttt{Arg2}) and displays
the output in line.
\begin{itemize}
@@ -279,7 +280,7 @@
between "```" on both sides (as in the markdown grammar), then it
will be implemented directly; otherwise the code will be written to
a file on the disk and then be called.
-\item \texttt{Arg3} has the same effect as that of the basic command \texttt{\textbackslash{}inln}.
+\item \texttt{Arg3} and \texttt{Arg4} have the same effects as those of the basic command \texttt{\textbackslash{}inln}.
\end{itemize}
\item \texttt{\textbackslash{}runPythonBatch[Arg1][Arg2]} runs an external
\href{https://www.python.org/}{Python} code file in batch mode (without a
@@ -308,7 +309,7 @@
\item \texttt{Arg2}, \texttt{Arg3}, and \texttt{Arg4} have the same effects as those of the
basic command \texttt{\textbackslash{}runExtCode}.
\end{itemize}
-\item \texttt{\textbackslash{}inlnR[Arg1]\{Arg2\}[Arg3]} runs \href{https://www.r-project.org/}{R}
+\item \texttt{\textbackslash{}inlnR[Arg1]\{Arg2\}[Arg3][Arg4]} runs \href{https://www.r-project.org/}{R}
source code (\texttt{Arg2}) and displays the output in line.
\begin{itemize}
\item \texttt{Arg1} is optional and uses the \href{https://www.r-project.org/}{R}
@@ -318,14 +319,16 @@
between "```" on both sides (as in the markdown grammar), then it
will be implemented directly; otherwise the code will be written to
a file on the disk and then be called.
-\item \texttt{Arg3} has the same effect as that of the basic command \texttt{\textbackslash{}inln}.
+\item \texttt{Arg3} and \texttt{Arg4} have the same effects as those of the basic command \texttt{\textbackslash{}inln}.
\end{itemize}
\end{itemize}
\section{Revisions}
-\label{sec:orgf884e2e}
+\label{sec:orgdd95675}
\begin{itemize}
+\item v1.9, June 13, 2023: Update \texttt{\textbackslash{}inln} command; the optional \texttt{Arg3} is the output
+file name and the optional \texttt{Arg4} is the output type.
\item v1.8, January 18, 2023, add support to \href{https://ctan.org/pkg/listings?lang=en}{listings.}
\item v1.7, August 20, 2022: changed the tmp/ folder to generated/ in order to
conform with CTAN suggestions; renamed the troubleshooting file.
@@ -344,7 +347,7 @@
\end{itemize}
\section{Contributing}
-\label{sec:org0dce33b}
+\label{sec:orge68f2c0}
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 2023-06-14 20:14:16 UTC (rev 67366)
+++ trunk/Master/texmf-dist/tex/latex/runcode/runcode.sty 2023-06-14 20:14:27 UTC (rev 67367)
@@ -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/01/18 runcode v1.8]
+\ProvidesPackage{runcode}[2023/06/13 runcode v1.9]
\newif\ifruncode
% Change to \runcodefalse if you want to suspend code execution
@@ -313,13 +313,17 @@
% \inln{Arg #1}{Arg #2}[Arg #3] is used to execute short source code
% and embed resulting output.
% Arg #1 is the executable program;
-% Arg #2 is the source code
-% Arg #3 is the type output (if skipped or with empty value the default type is
+% Arg #2 is the source code;
+% Arg #3 is the output file name (optional);
+% Arg #4 is the type output (if skipped or with empty value the default type is
% inline; vbox = verbatim in a box);
-\NewDocumentCommand{\inln}{m m O{inline}}{\-
- \stepcounter{codeOutput}\unskip
- \unskip\setvalue{\tmpname}{\generated/\jobname_inln\thecodeOutput}\unskip\unskip\unskip
+\NewDocumentCommand{\inln}{m m O{} O{inline}}{\-
+ \unskip
+ \ifthenelse{\isempty{#3}}
+ {\stepcounter{codeOutput}\unskip\unskip\setvalue{\tmpname}{\generated/\jobname_inln\thecodeOutput}\unskip\unskip\unskip}
+ {\unskip\setvalue{\tmpname}{\generated/#3}\unskip\unskip\unskip}
+ \unskip\unskip\unskip
\ifruncode % cache mode - don't try to run the code, just get the previous results
\IfBeginWith{#2}{```}{\ifruncode\immediate\write18{#1 > \tmpname.tex}\unskip\fi}
{\newwrite\tempfile
@@ -332,7 +336,7 @@
\fi % end cache mode
\IfFileExists{\tmpname.tex}
{\checkZeroBytes{\tmpname.tex}\unskip
- \ifstrequal{#3}{vbox}
+ \ifstrequal{#4}{vbox}
{\begin{tcolorbox}
\ifminted\unskip
\inputminted{text}{\tmpname.tex}\unskip
@@ -354,7 +358,7 @@
{\runExtCode{#1}{#2}{#3}[#4]}
}
-\NewDocumentCommand{\inlnR}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","R","\tmpname.txt")'} m O{inline}}{\IfBeginWith{#2}{```}{\inln{python3 -c 'from talk2stat.talk2stat import client;rc0="""#2""";rc0=rc0.lstrip("```").rstrip("```");client("./","R",f"```{rc0}```")'}{#2}[#3]}{\inln{#1}{#2}[#3]}}
+\NewDocumentCommand{\inlnR}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","R","\tmpname.txt")'} m O{} O{inline}}{\IfBeginWith{#2}{```}{\inln{python3 -c 'from talk2stat.talk2stat import client;rc0="""#2""";rc0=rc0.lstrip("```").rstrip("```");client("./","R",f"```{rc0}```")'}{#2}[#3][#4]}{\inln{#1}{#2}[#3][#4]}}
\NewDocumentCommand{\runJulia}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","julia","#2")'} m m O{}}
{
@@ -364,7 +368,7 @@
{\runExtCode{#1}{#2}{#3}[#4]}
}
-\NewDocumentCommand{\inlnJulia}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","julia","\tmpname.txt")'} m O{inline}}{\IfBeginWith{#2}{```}{\inln{python3 -c 'from talk2stat.talk2stat import client;rc0="""#2""";rc0=rc0.lstrip("```").rstrip("```");client("./","julia",f"```{rc0}```")'}{#2}[#3]}{\inln{#1}{#2}[#3]}}
+\NewDocumentCommand{\inlnJulia}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","julia","\tmpname.txt")'} m O{} O{inline}}{\IfBeginWith{#2}{```}{\inln{python3 -c 'from talk2stat.talk2stat import client;rc0="""#2""";rc0=rc0.lstrip("```").rstrip("```");client("./","julia",f"```{rc0}```")'}{#2}[#3][#4]}{\inln{#1}{#2}[#3][#4]}}
\NewDocumentCommand{\runMatlab}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","matlab","#2")'} m m O{}}
{
@@ -374,7 +378,7 @@
{\runExtCode{#1}{#2}{#3}[#4]}
}
-\NewDocumentCommand{\inlnMatlab}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","matlab","\tmpname.txt")'} m O{inline}}{\IfBeginWith{#2}{```}{\inln{python3 -c 'from talk2stat.talk2stat import client;rc0="""#2""";rc0=rc0.lstrip("```").rstrip("```");client("./","matlab",f"```{rc0}```")'}{#2}[#3]}{\inln{#1}{#2}[#3]}}
+\NewDocumentCommand{\inlnMatlab}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","matlab","\tmpname.txt")'} m O{} O{inline}}{\IfBeginWith{#2}{```}{\inln{python3 -c 'from talk2stat.talk2stat import client;rc0="""#2""";rc0=rc0.lstrip("```").rstrip("```");client("./","matlab",f"```{rc0}```")'}{#2}[#3][#4]}{\inln{#1}{#2}[#3][#4]}}
\NewDocumentCommand{\runPython}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","python","#2")'} m m O{}}
@@ -385,7 +389,7 @@
{\runExtCode{#1}{#2}{#3}[#4]}
}
-\NewDocumentCommand{\inlnPython}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","python","\tmpname.txt")'} m O{inline}}{\IfBeginWith{#2}{```}{\inln{python3 -c 'from talk2stat.talk2stat import client;rc0="""#2""";rc0=rc0.lstrip("```").rstrip("```");client("./","python",f"```{rc0}```")'}{#2}[#3]}{\inln{#1}{#2}[#3]}}
+\NewDocumentCommand{\inlnPython}{O{python3 -c 'from talk2stat.talk2stat import client; client("./","python","\tmpname.txt")'} m O{} O{inline}}{\IfBeginWith{#2}{```}{\inln{python3 -c 'from talk2stat.talk2stat import client;rc0="""#2""";rc0=rc0.lstrip("```").rstrip("```");client("./","python",f"```{rc0}```")'}{#2}[#3][#4]}{\inln{#1}{#2}[#3][#4]}}
%%%%%%%%
More information about the tex-live-commits
mailing list.