diff options
Diffstat (limited to 'macros/latex/contrib/runcode/runcode.tex')
-rw-r--r-- | macros/latex/contrib/runcode/runcode.tex | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/macros/latex/contrib/runcode/runcode.tex b/macros/latex/contrib/runcode/runcode.tex index 8751d4234e..04c67fd5a2 100644 --- a/macros/latex/contrib/runcode/runcode.tex +++ b/macros/latex/contrib/runcode/runcode.tex @@ -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 @@ package’s github repository, at \url{https://github.com/Ossifragus/runcode}. \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 @@ compiling a \LaTeX{} document. \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 @@ be customized with \texttt{\textbackslash{}tcbset}, \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,14 +182,15 @@ value \texttt{vbox} \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. \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 @@ text. \end{itemize} \subsection{Language specific shortcuts:} -\label{sec:org591e87e} +\label{sec:org7b04bad} \href{https://julialang.org/}{Julia} \begin{itemize} @@ -211,7 +212,7 @@ text. \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 @@ If the \href{https://julialang.org/}{Julia} source code is wrapped 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 @@ default. \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 to run. If the 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 @@ will be written to a file on the disk and then be called. \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 @@ If the \href{https://www.python.org/}{Python} source 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} \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 @@ installed via \texttt{pip3 install dill}. \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 @@ If the \href{https://www.r-project.org/}{R} source 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} \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 @@ code files, zero bytes in output files.) \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}. |