texlive[63939] Master/texmf-dist: runcode (19jul22)

commits+karl at tug.org commits+karl at tug.org
Tue Jul 19 22:09:22 CEST 2022


Revision: 63939
          http://tug.org/svn/texlive?view=revision&revision=63939
Author:   karl
Date:     2022-07-19 22:09:22 +0200 (Tue, 19 Jul 2022)
Log Message:
-----------
runcode (19jul22)

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	2022-07-19 20:09:11 UTC (rev 63938)
+++ trunk/Master/texmf-dist/doc/latex/runcode/README	2022-07-19 20:09:22 UTC (rev 63939)
@@ -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

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	2022-07-19 20:09:11 UTC (rev 63938)
+++ trunk/Master/texmf-dist/doc/latex/runcode/runcode.tex	2022-07-19 20:09:22 UTC (rev 63939)
@@ -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 at uconn.edu}, \texttt{haiying.wang at uconn.edu}}
     \maketitle
 
@@ -166,6 +166,7 @@
 
 \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.)

Modified: trunk/Master/texmf-dist/tex/latex/runcode/runcode.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/runcode/runcode.sty	2022-07-19 20:09:11 UTC (rev 63938)
+++ trunk/Master/texmf-dist/tex/latex/runcode/runcode.sty	2022-07-19 20:09:22 UTC (rev 63939)
@@ -171,6 +171,8 @@
     \ifthenelse{\isempty{#3}}{
     \ifminted
     \inputminted{#1}{#2}
+    \vspace{-\medskipamount}
+    \vspace{-\baselineskip}
     \else
     \VerbatimInput[fontsize=\footnotesize,linenos=true,frame=single,breaklines]{#2}
     \fi
@@ -177,6 +179,8 @@
   }{
     \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



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