texlive[63280] Master/texmf-dist: hvextern (11may22)

commits+karl at tug.org commits+karl at tug.org
Wed May 11 21:51:39 CEST 2022


Revision: 63280
          http://tug.org/svn/texlive?view=revision&revision=63280
Author:   karl
Date:     2022-05-11 21:51:39 +0200 (Wed, 11 May 2022)
Log Message:
-----------
hvextern (11may22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/hvextern/Changes
    trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
    trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex
    trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty

Modified: trunk/Master/texmf-dist/doc/latex/hvextern/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/Changes	2022-05-10 23:48:46 UTC (rev 63279)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/Changes	2022-05-11 19:51:39 UTC (rev 63280)
@@ -1,5 +1,8 @@
 hvextern.sty ----------------
 
+v 0.24 2022-05-11  - fix introduced bug for \hv at rm
+                   - added tcolorbox support for \runExtCmd
+                   . added keywords pagesep and mpsep
 v 0.23 2022-05-08  - added \runExtCmd
                    - added doctype shell
 v 0.22 2022-05-05  - added mpvalign, tclbox

Modified: trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex	2022-05-10 23:48:46 UTC (rev 63279)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex	2022-05-11 19:51:39 UTC (rev 63280)
@@ -1596,6 +1596,8 @@
 \item[\Lkeyword{ExamplesDir}] move all examples into a directory
 \item[\Lkeyset{tclbox=false}] Can be used if there are some negative interactions between package \Lpack{listings}
    and package \Lpack{tcolorbox}.
+\item[\Lkeyword{mpsep}] Distance between code and output (default 1\,em).
+\item[\Lkeyword{pagesep}] Distance between pages for multipage output (default 1\,em).
 \item[\Lkeyword{eps}] create an eps from the pdf (historical).
 \end{description}
 

Modified: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	2022-05-10 23:48:46 UTC (rev 63279)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	2022-05-11 19:51:39 UTC (rev 63280)
@@ -11,8 +11,8 @@
 %% and version 1.3c or later is part of all distributions of LaTeX
 %% version 2005/12/01 or later.
 
-\def\hvexternFileversion{0.23}
-\ProvidesFile{hvextern}[2022/05/08 v\hvexternFileversion: package for running external documents (HV)]
+\def\hvexternFileversion{0.24}
+\ProvidesFile{hvextern}[2022/05/11 v\hvexternFileversion: package for running external documents (HV)]
 
 \RequirePackage{shellesc,xkeyval,graphicx,marginnote,fancyvrb,tikz,listings,ifplatform}
 \RequirePackage{tcolorbox,xparse}
@@ -30,6 +30,8 @@
 \newcounter{@@@runs} 
 \newsavebox\hv at extern@box
 \newlength\hv at LineWidth
+\newlength\hv at extern@pagesep
+\newlength\hv at extern@mpsep
 \AtBeginDocument{\setlength\hv at LineWidth{\dimexpr\linewidth-2\fboxsep-2\fboxrule}}
 \newlength\hv at extern@mpwidth \setlength\hv at extern@mpwidth{\z@}
 
@@ -46,8 +48,10 @@
 \define at key{hv}{caption}[]{\def\hv at extern@caption{#1}}
 \define at key{hv}{label}[]{\def\hv at extern@label{#1}}
 \define at key{hv}{pages}[1]{\def\hv at extern@pages{#1}}
+\define at key{hv}{pagesep}[1em]{\hv at extern@pagesep=#1}
 \define at key{hv}{cropmargin}[2]{\def\hv at extern@cropmargin{#1 }}
 \define at key{hv}{mpwidth}[0pt]{\setlength\hv at extern@mpwidth{#1}}
+\define at key{hv}{mpsep}[1em]{\setlength\hv at extern@mpsep{#1}}
 \define at key{hv}{mpvalign}[t]{\def\hv at extern@mpvalign{#1}}
 \define at key{hv}{ext}[tex]{\def\hv at extern@ext{.#1}}
 \define at boolkey{hv}[hv at extern@]{redirect}[true]{}
@@ -91,7 +95,7 @@
  }
 
 \def\ResetKeys{%
- \setkeys{hv}{
+ \setkeys{hv}{%
   showFilename=false,%  Dateinamen im Rand angeben
   ext=tex,%             file extension
   code=false,%          show Code
@@ -118,6 +122,7 @@
   caption=,%	        keine Caption
   label=,%		kein Label
   pages=1,%		welche Seiten auszugeben sind
+  pagesep=1em,%         horizontal sep between pages
   docType=latex,%	LaTeX example Code
   cleanup={},% 	        Hilfsdateien nicht löschen
   moveToExampleDir=false,%  Verschieben nach ExamplesDir
@@ -147,7 +152,7 @@
  {
   \clist_map_inline:nn {#1}{\ShellEscape{\hv at rm \hv at extern@ExamplesDir\hvExternDateiname.##1}} 
   \ifnum\hv at extern@compilerNo=0\relax   % we have metapost
-    \hv at rm epsf.*
+    \ShellEscape{\hv at rm\space epsf.*}%
   \fi
  }
 \NewDocumentCommand\run at hv@extern at sequenceList{ m }
@@ -163,6 +168,7 @@
 \tcbset{breakable,left=2pt,right=2pt,top=2pt,bottom=2pt,boxsep=0pt}
 
 \newcommand\PreambleVerbatim[2][]{%
+  \hv at typeout{Running PreambleVerbatim with #1, #2}%
   \ifhv at extern@tcbox
     \begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}%
   \else
@@ -170,6 +176,7 @@
   \fi}
 
 \newcommand\BodyVerbatim[2][]{%
+  \hv at typeout{Running BodyVerbatim with #1, #2}%
   \ifhv at extern@tcbox
     \begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}%
   \else
@@ -177,13 +184,15 @@
   \fi}
 
 \newcommand\PreambleListing[2][]{%
+  \hv at typeout{Running PreambleListing with #1, #2}%
   \ifhv at extern@tcbox 
     \begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}%
-  \else
+  \else    
     \expandafter\lstinputlisting\expandafter[#1]{#2}%
   \fi}
 
 \newcommand\BodyListing[2][]{%
+  \hv at typeout{Running BodyListing with #1, #2}%
   \ifhv at extern@tcbox 
     \begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}%
   \else
@@ -321,9 +330,9 @@
          \global\hv at extern@forcetrue}}}%   set force, if no pdf or png exists
    \begingroup
    \hv at typeout{>>> writing file \hvExternDateiname\hv at extern@ext ...}%
-   \filecontents[force,noheader]{\hvExternDateiname\hv at extern@ext}
+   \filecontents[force,noheader]{\hvExternDateiname\hv at extern@ext}%
   }
-  {\endfilecontents%         \end
+  {\endfilecontents%         \end%
    \hv at typeout{>>> ... done}%
    \global\stepcounter{hv at example@counter}%
    \endgroup
@@ -383,7 +392,7 @@
          % we need lstinputlisting, because \VerbatimInput doesn't work in a box
          \savebox\hv at extern@box{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternDateiname\hv at extern@ext}}%
 %         \savebox\hv at extern@box{\VerbatimInput{\hvExternDateiname\hv at extern@ext}}%
-         \ifdim\wd\hv at extern@box > \z@
+         \ifdim\wd\hv at extern@box > \z@\relax
            \expandafter\fvset\expandafter{\hv at extern@lstOptions}%
            \tcbset{colback=\hv at extern@BGpreamble,colframe=\hv at extern@BOpreamble}%
            \PreambleVerbatim{\hvExternDateiname\hv at extern@ext}%
@@ -391,7 +400,7 @@
       \else
         \edef\@@@temp{\@nameuse{\hv at extern@docType @initPreamble}}%
         \savebox\hv at extern@box{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternDateiname\hv at extern@ext}}%
-        \ifdim\wd\hv at extern@box>\z@
+        \ifdim\wd\hv at extern@box>\z@\relax
           \expandafter\lstset\expandafter{\hv at extern@lstOptions}%
           \tcbset{colback=\hv at extern@BGpreamble,colframe=\hv at extern@BOpreamble}%
           \PreambleListing[\@@@temp]{\hvExternDateiname\hv at extern@ext}%
@@ -447,12 +456,12 @@
        \ifhv at extern@frame
          \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv at extern@pages\do{%
            \fbox{\expandafter\includegraphics\expandafter[\hv at extern@grfOptions,page=\next]{\hv at extern@ExamplesDir\hvExternDateiname}}%
-              \hspace{5pt}}\hspace*{-5pt}%
+              \hspace{\hv at extern@pagesep}}\hspace*{-\hv at extern@pagesep}%
        \else
          \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv at extern@pages\do{%
            \expandafter\includegraphics\expandafter[\hv at extern@grfOptions,page=\next]%
              {\hv at extern@ExamplesDir\hvExternDateiname}%
-              \hspace{5pt}}\hspace*{-5pt}%
+              \hspace{\hv at extern@pagesep}}\hspace*{-\hv at extern@pagesep}%
        \fi
        \ifx\hv at extern@caption\@empty\else\caption{\hv at extern@caption}\fi
        \ifx\hv at extern@label\@empty\else\label{\hv at extern@label}\fi
@@ -464,11 +473,21 @@
      \fi
    \else% no graphic, only text
      \ifdim\hv at extern@mpwidth>\z@ 
-       \hfill\minipage[t]{\dimexpr\linewidth-\hv at extern@mpwidth-1em\relax}\vspace{0pt}
-       \noindent\BodyListing{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+       \hfill\minipage[t]{\dimexpr\linewidth-\hv at extern@mpwidth-\hv at extern@mpsep\relax}\vspace{0pt}
+       \noindent
+       \ifhv at extern@usefancyvrb
+         \expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}%
+       \else
+         \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}%
+       \fi
        \endminipage
      \else
-       \noindent\BodyListing{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+       \noindent
+       \ifhv at extern@usefancyvrb
+         \expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}%
+       \else
+         \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}%
+       \fi
      \fi
    \fi
    \ifhv at extern@force\expandafter\run at hv@extern at cleanup\expandafter{\hv at extern@cleanup}\fi%   cleanup
@@ -524,12 +543,21 @@
      \ifhv at extern@float
        \hv at typeout{>>>> Floating environment}% 
        \begin{figure}[!htb]
-       \noindent\BodyListing{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+       \ifhv at extern@usefancyvrb
+         \expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+       \else     
+         \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+       \fi
        \ifx\hv at extern@caption\@empty\else\caption{\hv at extern@caption}\fi
        \ifx\hv at extern@label\@empty\else\label{\hv at extern@label}\fi
        \end{figure}
      \else
-       \noindent\BodyListing{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+       \noindent
+       \ifhv at extern@usefancyvrb
+         \expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+       \else     
+         \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+       \fi
      \fi
    \fi
    \ifhv at extern@force\expandafter\run at hv@extern at cleanup\expandafter{\hv at extern@cleanup}\fi%   cleanup



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