summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/runcode
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-07-20 03:00:57 +0000
committerNorbert Preining <norbert@preining.info>2022-07-20 03:00:57 +0000
commit2773132ea593028dafe764f7560fd94ecb827d3d (patch)
tree1ec66117c0fd26fa54a99c69602512a8f96bb9af /macros/latex/contrib/runcode
parent8ff4930a7a6c0dcfef1066c5537747570c7967b3 (diff)
CTAN sync 202207200300
Diffstat (limited to 'macros/latex/contrib/runcode')
-rw-r--r--macros/latex/contrib/runcode/README2
-rw-r--r--macros/latex/contrib/runcode/runcode.pdfbin54171 -> 55816 bytes
-rw-r--r--macros/latex/contrib/runcode/runcode.sty24
-rw-r--r--macros/latex/contrib/runcode/runcode.tex5
4 files changed, 19 insertions, 12 deletions
diff --git a/macros/latex/contrib/runcode/README b/macros/latex/contrib/runcode/README
index 15a32aa794..8df8d236f2 100644
--- a/macros/latex/contrib/runcode/README
+++ b/macros/latex/contrib/runcode/README
@@ -1,4 +1,4 @@
-LaTeX Package: runcode 2022/05/03 v1.2
+LaTeX Package: runcode 2022/07/13 v1.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
diff --git a/macros/latex/contrib/runcode/runcode.pdf b/macros/latex/contrib/runcode/runcode.pdf
index 4380e8bf59..a13ff9b018 100644
--- a/macros/latex/contrib/runcode/runcode.pdf
+++ b/macros/latex/contrib/runcode/runcode.pdf
Binary files differ
diff --git a/macros/latex/contrib/runcode/runcode.sty b/macros/latex/contrib/runcode/runcode.sty
index 79da32c579..626dc05aaa 100644
--- a/macros/latex/contrib/runcode/runcode.sty
+++ b/macros/latex/contrib/runcode/runcode.sty
@@ -171,12 +171,16 @@
\ifthenelse{\isempty{#3}}{
\ifminted
\inputminted{#1}{#2}
+ \vspace{-\medskipamount}
+ \vspace{-\baselineskip}
\else
\VerbatimInput[fontsize=\footnotesize,linenos=true,frame=single,breaklines]{#2}
\fi
}{
\ifminted
\inputminted[firstline=#3, lastline=#4, firstnumber=1]{#1}{#2}
+ \vspace{-\medskipamount}
+ \vspace{-\baselineskip}
\else
\VerbatimInput[fontsize=\footnotesize,linenos=true,frame=single,breaklines, firstline=#3, lastline=#4, firstnumber=1]{#2}
\fi
@@ -232,7 +236,7 @@
\IfFileExists{\tmpname}
{
\ifstrequal{#2}{vbox}
- {\begin{tcolorbox}
+ {\begin{tcolorbox}[colframe=blue!25,colback=blue!10]
\ifminted\unskip
\inputminted[fontsize=\footnotesize,breaklines=true]{text}{\tmpname}\unskip
\else\unskip
@@ -264,18 +268,20 @@
\NewDocumentCommand{\inln}{m m O{inline}}{\-
\stepcounter{codeOutput}\unskip
\unskip\setvalue{\tmpname}{tmp/\jobname_inln\thecodeOutput}\unskip\unskip\unskip
- \IfBeginWith{#2}{```}{\ifruncode\immediate\write18{#1 > \tmpname.tex}\unskip\fi}
- {\newwrite\tempfile
- \immediate\openout\tempfile=\tmpname.txt
- \immediate\write\tempfile{#2}
- \immediate\closeout\tempfile
- \ifruncode
- \immediate\write18{#1 \tmpname.txt > \tmpname.tex}\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
+ \immediate\openout\tempfile=\tmpname.txt
+ \immediate\write\tempfile{#2}
+ \immediate\closeout\tempfile
+ \ifruncode
+ \immediate\write18{#1 \tmpname.txt > \tmpname.tex}\unskip
\fi}
+ \fi % end cache mode
\IfFileExists{\tmpname.tex}
{\checkZeroBytes{\tmpname.tex}\unskip
\ifstrequal{#3}{vbox}
- {\begin{tcolorbox}
+ {\begin{tcolorbox}[colframe=blue!25,colback=blue!10]
\ifminted\unskip
\inputminted[fontsize=\footnotesize,breaklines=true]{text}{\tmpname.tex}\unskip
\else\unskip
diff --git a/macros/latex/contrib/runcode/runcode.tex b/macros/latex/contrib/runcode/runcode.tex
index eadfc13c15..cb9edfea0f 100644
--- a/macros/latex/contrib/runcode/runcode.tex
+++ b/macros/latex/contrib/runcode/runcode.tex
@@ -15,9 +15,9 @@
\documentclass{ltxdoc}
\usepackage[hyphens]{url}
%\usepackage{runcode}
-\ProvidesPackage{runcode}[2022/05/14 runcode v1.3]
+\ProvidesPackage{runcode}[2022/07/18 runcode v1.4]
\begin{document}
- \title{The \textsf{runcode} package\thanks{This document corresponds to \textsf{runcode}~v1.3, dated~2022/05/14.}}
+ \title{The \textsf{runcode} package\thanks{This document corresponds to \textsf{runcode}~v1.4, dated~2022/07/18.}}
\author{Haim Bar and HaiYing Wang \\ \texttt{haim.bar@uconn.edu}, \texttt{haiying.wang@uconn.edu}}
\maketitle
@@ -166,6 +166,7 @@ Available options are:
\section{Revisions}
\begin{itemize}
+\item v1.4, July 18, 2022: Fixed a bug in the cache mode.
\item v1.3, May 14, 2022: Removed the hard-coded minted options.
\item v1.2, May 3, 2022: Added python options (server and batch).
\item v1.1, April 17, 2021: Added a nohup option; improved error handling (missing code files, zero bytes in output files.)