texlive[63380] Master/texmf-dist: hvextern (23may22)

commits+karl at tug.org commits+karl at tug.org
Mon May 23 21:56:28 CEST 2022


Revision: 63380
          http://tug.org/svn/texlive?view=revision&revision=63380
Author:   karl
Date:     2022-05-23 21:56:28 +0200 (Mon, 23 May 2022)
Log Message:
-----------
hvextern (23may22)

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-23 19:56:14 UTC (rev 63379)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/Changes	2022-05-23 19:56:28 UTC (rev 63380)
@@ -1,5 +1,7 @@
 hvextern.sty ----------------
 
+v 0.26 2022-05-23  - set filenames for twocolumn mode outer/inner
+                   - added keywords outerFN and shiftFN
 v 0.25 2022-05-19  - added framesep keyword
                    - added keywords for vertical space
                    - added keyword textOptions for reading text output

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-23 19:56:14 UTC (rev 63379)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex	2022-05-23 19:56:28 UTC (rev 63380)
@@ -30,7 +30,7 @@
 
 %\newpage
 
-\setkeys{hv}{moveToExampleDir,ExampleDir=Examples,showFilename,verbose}
+\setkeys{hv}{moveToExampleDir,ExampleDir=Exa,showFilename,verbose}
 \section{Syntax}
 
 \begin{verbatim}
@@ -268,7 +268,19 @@
 \end{externalDocument}
 
 
+The external filename, extended by a consequtive number, kan be printed in the
+margin by setting the keyword \Lkeyword{showFilename}. In general it is printed 
+in the outer margin or in twocolumn mode in the outer column. If the example is
+set in twocolumn mode but inside a starred floating environment over both
+column, then use the keyword \Lkeyword{outerFN}. Then \Lpack{hvextern} doesn't
+test for twocolumn mode.
 
+A vertical shift of the filename is possible by setting a length to the keyword \Lkeyword{shiftFN},
+e.g. \texttt{shiftFN=5ex}. 
+
+
+\clearpage%%%%%%%%%%%%
+
 \begin{externalDocument}[grfOptions={width=0.95\linewidth},
   compiler=xelatex,code,mpwidth=0.6\linewidth,
   crop,cleanup,force=false,usefancyvrb=false,ext=tex,showFilename=false]{voss}
@@ -412,9 +424,6 @@
 \end{externalDocument}
 
 
-
-
-
 The following \Java-program creates the Mandelbrot set as png image. The valid setting for 
 the environment \Lenv{externalDocument} is:
 
@@ -681,6 +690,7 @@
 \begin{externalDocument}[
   pages={1,2,3},
   pagesep=2pt,
+  shiftFN=5ex,
   grfOptions={width=0.3\linewidth},
 %  lstOptions={fontsize=\small,fontfamily=tt},
   compiler=lualatex, runs=2,
@@ -690,7 +700,7 @@
 %  mpwidth=0.6\linewidth,
 %  crop,
   cleanup,
-  force=true,
+  force=false,
   frame,
 %  usefancyvrb,
 %  float,
@@ -743,7 +753,7 @@
 %  mpwidth=0.6\linewidth,
   crop,
   cleanup,
-  force=true,
+  force=false,
   usefancyvrb,
   float,
   floatsetting=!ht,
@@ -1016,7 +1026,7 @@
     \hv at extern@showFilenamefalse}
 \end{verbatim}
 
-With the setting \LKeyset{inline=true} the optional keyword \Lkeyword{code} 
+With the setting \LKeyset{inline=true} the optional keyword \Lkeyword{code}  and \Lkeyword{showFilename}
 is automatically set to false. The
 next  Chinese characters 
 \begin{externalDocument}[
@@ -1078,7 +1088,7 @@
 
 \begin{externalDocument}[
   compiler=perl, force=false, docType=pl, ext=pl, includegraphic=false,
-  code, mpwidth=0.6\linewidth, showFilename=false]{voss}
+  code, mpwidth=0.6\linewidth]{voss}
 #!/usr/bin/perl
 #
 # Herbert Voss 2005-05-31
@@ -1133,7 +1143,8 @@
 
 \begin{externalDocument}[
   compiler=lua, force=false, docType=lua, ext=lua, includegraphic=false, 
-  code, usefancyvrb=false,textOptions={basicstyle=\ttfamily\footnotesize}]{voss}
+  code, usefancyvrb=false,textOptions={basicstyle=\ttfamily\footnotesize},
+  shiftFN=6ex]{voss}
 #!/usr/bin/env lua
 local filename = arg[0]
 local shortFN = filename:match("(.+)%..+")
@@ -1211,7 +1222,6 @@
   xindexOptions={-l DE --config AU},
   mpwidth=0.6\linewidth,
   usefancyvrb=false,
-  showFilename=false,
   docType=latex]{voss}
 \documentclass[paper=a6,DIV=18,parskip=half-]{screxa}
 \pagestyle{empty}
@@ -1262,7 +1272,6 @@
   pagesep=2pt,
   frame,
   runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex},
-  showFilename,
   verbose,
   force=false,
   cleanup={log,aux,toc,bbl,blg},
@@ -1304,7 +1313,6 @@
   grfOptions={width=0.45\linewidth},
   pages={1,3},
   frame,compiler=pdflatex,
-  showFilename,
 %  crop,
   force=false,runs=2,code,docType=latex,
   frame,
@@ -1641,6 +1649,11 @@
 \section{Other options}
 
 \begin{description}
+%\item[\Lkeyword{showFilename}] Prints the filename in the outer margin (right for oneside) or in twocolumn mode for
+%    the first column in the left and the second column in the right margin.
+%\item[\Lkeyword{outerFN}] Only valid for the twocolumn mode with onecolumn floats (environment \texttt{figure*}),
+%    to get the filename on the right or left of the whole page.
+%\item[\Lkeyword{shiftFN}] A length to move the printed filename up or down.
 \item[\Lkeyset{force=false}] can speed up the comiling time for the document. If a created image/output
 already exists, there is no need to create it with the next run again and again.
 \item[\Lkeyword{cleanup}] the auxiliary files of a \LaTeX-run are deleted, preset to \texttt{aux}, \texttt{log}.

Modified: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	2022-05-23 19:56:14 UTC (rev 63379)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	2022-05-23 19:56:28 UTC (rev 63380)
@@ -11,11 +11,12 @@
 %% and version 1.3c or later is part of all distributions of LaTeX
 %% version 2005/12/01 or later.
 
-\def\hvexternFileversion{0.25}
-\ProvidesFile{hvextern}[2022/05/19 v\hvexternFileversion: package for running external documents (HV)]
+\def\hvexternFileversion{0.26}
+\ProvidesFile{hvextern}[2022/05/23 v\hvexternFileversion: package for running external documents (HV)]
 
 \RequirePackage{shellesc,xkeyval,graphicx}
 \RequirePackage{fancyvrb,tikz,listings,ifplatform}
+\RequirePackage{ifoddpage}
 \RequirePackage{tcolorbox,xparse}
 \tcbuselibrary{skins,breakable}
 
@@ -39,6 +40,7 @@
 \newlength\hv at extern@belowpreambleskip
 \newlength\hv at extern@belowbodyskip
 \newlength\hv at extern@belowskip
+\newlength\hv at extern@shiftFN
 
 \AtBeginDocument{\setlength\hv at LineWidth{\dimexpr\linewidth-2\fboxsep-2\fboxrule}}
 \newlength\hv at extern@mpwidth \setlength\hv at extern@mpwidth{\z@}
@@ -72,6 +74,8 @@
 \define at boolkey{hv}[hv at extern@]{redirect}[true]{}
 \define at boolkey{hv}[hv at extern@]{usefancyvrb}[true]{}
 \define at boolkey{hv}[hv at extern@]{showFilename}[true]{}
+\define at boolkey{hv}[hv at extern@]{outerFN}[true]{}
+\define at key{hv}{shiftFN}[0pt]{\setlength\hv at extern@shiftFN{#1}}
 \define at boolkey{hv}[hv at extern@]{code}[true]{}
 \define at boolkey{hv}[hv at extern@]{force}[true]{}
 \define at boolkey{hv}[hv at extern@]{crop}[true]{}
@@ -98,7 +102,6 @@
 \define at boolkey{hv}[hv at extern@]{eps}[true]{}
 \define at boolkey{hv}[hv at extern@]{verbose}[true]{}
 \def\hv at typeout#1{\ifhv at extern@verbose\typeout{#1}\fi}
-%\define at key{hv}{compiler}[pdflatex]{\def\hv at extern@compiler{#1}}
 \define at choicekey*+{hv}{compiler}[\val\nr]{mpost,tex,latex,luatex,python3,perl,lua,java,%
      xetex,pdflatex,lualatex,xelatex,context,sh,texlua}[pdflatex]{% 
   \hv at typeout{>>>> Compiler type \nr}%
@@ -113,9 +116,13 @@
 \define at key{hv}{belowbodyskip}[\smallskipamount]{\setlength\hv at extern@belowbodyskip{#1}}
 \define at key{hv}{belowskip}[\medskipamount]{\setlength\hv at extern@belowskip{#1}}
 
+\def\hvExternSetKeys#1{\setkeys{hv}{#1}}
+
 \def\ResetKeys{%
  \setkeys{hv}{%
   showFilename=false,%  Dateinamen im Rand angeben
+  outerFN=false,%       use fullwidth in twocolumn mode (starred floats)
+  shiftFN=\z@,%         raise printed filename
   ext=tex,%             file extension
   code=false,%          show Code
   crop=false,%		erzeugte PDF "croppen"
@@ -164,6 +171,7 @@
   }%
 }
 
+
 \ResetKeys
 
 {\catcode`\%=12
@@ -195,7 +203,39 @@
 \tcbset{breakable,left=2pt,right=2pt,top=2pt,bottom=2pt,boxsep=0pt}
 
 \def\hv at marginpar#1{%
-  \makebox[\dimexpr\hv at TextWidth+\marginparsep-1ex][r]{\makebox(0,0){\rotatebox[origin=lb]{90}{#1}}}%
+  \leavevmode\checkoddpage
+  \sbox\hv at extern@box{\rotatebox[origin=C]{90}{\rule{2\hv at extern@shiftFN}{0pt}#1}}%
+  \ht\hv at extern@box=\z@ \wd\hv at extern@box=\z@ \dp\hv at extern@box=\z@
+  \noindent
+  \ifoddpage%    we have a right page
+    \if at twocolumn
+      \ifhv at extern@outerFN
+        \makebox[\dimexpr\hv at TextWidth+\marginparsep-1.5ex][r]{\usebox\hv at extern@box}%
+      \else      
+        \if at firstcolumn
+          \llap{\usebox\hv at extern@box\rule{2.5ex}{0pt}}%
+        \else
+          \makebox[\dimexpr\hv at TextWidth+\marginparsep-1.5ex][r]{\usebox\hv at extern@box}%
+        \fi
+      \fi
+    \else  
+      \makebox[\dimexpr\hv at TextWidth+\marginparsep-1.5ex][r]{\usebox\hv at extern@box}%  
+    \fi
+  \else%       we have an even page (left page)
+    \if at twocolumn
+      \ifhv at extern@outerFN
+        \llap{\usebox\hv at extern@box\rule{2.5ex}{0pt}}%   left page left side
+      \else
+        \if at firstcolumn
+          \llap{\usebox\hv at extern@box\rule{2.5ex}{0pt}}%   left page left side
+        \else
+          \makebox[\dimexpr\hv at TextWidth+\marginparsep-1.5ex][r]{\usebox\hv at extern@box}% left page right side
+        \fi
+      \fi
+    \else  
+      \llap{\usebox\hv at extern@box\rule{2.5ex}{0pt}}%   onecolumn left page left side
+    \fi
+  \fi  
 }
 
 \newcommand\PreambleVerbatim[2][]{%
@@ -353,8 +393,10 @@
 %%
 %% [#1]: Optionen  #2: Dateiname
 %%
-\newenvironment{externalDocument}[2][]{%
+\newenvironment{externalDocument}[2][]
+  {%
    \xdef\hvExternDateiname{#2-\arabic{hv at example@counter}}%
+   \gdef\hv at extern@savePara{#1}%
    \setkeys{hv}{#1}%                   \begin
    \hv at typeout{External filename: \hvExternDateiname}%
    \expandafter\IfFileExists\expandafter{\hv at extern@ExamplesDir\hvExternDateiname.pdf}{}{%  
@@ -369,6 +411,8 @@
    \hv at typeout{>>> ... done}%
    \global\stepcounter{hv at example@counter}%
    \endgroup
+   \expandafter\hvExternSetKeys\expandafter{\hv at extern@savePara}%
+   \xdef\hv at extern@fullPath{\hv at extern@ExamplesDir\hvExternDateiname}%
    \ifhv at extern@force
      \ifx\hv at extern@runsequence\@empty
        \hv at typeout{>>>> force=true: running \hv at extern@progpath\hv at extern@compiler~ \hvExternDateiname\hv at extern@ext ...}%
@@ -417,7 +461,15 @@
    \ifhv at extern@code%--------------        Code Part
      \hv at typeout{>>>>Starting Code part with preamble ...}%
      \begingroup
-       \hv at TextWidth=\textwidth
+       \if at twocolumn
+         \ifhv at extern@outerFN
+           \hv at TextWidth=\textwidth
+         \else
+           \hv at TextWidth=\columnwidth
+         \fi
+       \else
+         \hv at TextWidth=\textwidth
+       \fi
        \ifdim\hv at extern@mpwidth>\z@ 
          \noindent
          \minipage[\hv at extern@mpvalign]{\hv at extern@mpwidth}
@@ -477,12 +529,12 @@
    \ifhv at extern@moveToExampleDir
 %     \ShellEscape{mkdir\space\hv at extern@ExamplesDir/}%
      \hv at typeout{>>>> Move file into example dir}% 
-     \hv at typeout{>>>>>>\hvExternDateiname ---- \hv at extern@ExamplesDir}%
+     \hv at typeout{>>>>>>\hvExternDateiname ----> \hv at extern@ExamplesDir}%
      \ShellEscape{\hv at move \hvExternDateiname.*\space \hv at extern@ExamplesDir}%
    \fi
    \ifhv at extern@includegraphic
      \ifhv at extern@inline
-       \expandafter\includegraphics\expandafter[\hv at extern@grfOptions]{\hv at extern@ExamplesDir\hvExternDateiname}%
+       \expandafter\includegraphics\expandafter[\hv at extern@grfOptions]{\hv at extern@fullPath}%
      \else
        \ifhv at extern@float
          \hv at typeout{>>>> Floating environment}% 
@@ -498,19 +550,21 @@
          \fi
        \fi
        \hv at extern@align
-       \hv at typeout{>>>> Input image \hv at extern@ExamplesDir\hvExternDateiname}% 
+       \hv at typeout{>>>> Input image \hv at extern@fullPath}% 
        \ifhv at extern@frame
          \begingroup
          \fboxsep=\hv at extern@framesep
          \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv at extern@pages\do{%
+           \hv at typeout{>>>> Image loop: next=\next\space \hv at extern@fullPath}% 
            \fbox{\expandafter\includegraphics\expandafter[\hv at extern@grfOptions,page=\next]%
-             {\hv at extern@ExamplesDir\hvExternDateiname}}\hspace{\hv at extern@pagesep}}%
+             {\hv at extern@fullPath}}\hspace{\hv at extern@pagesep}}%
          \hspace*{-\hv at extern@pagesep}%
          \endgroup
        \else
          \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv at extern@pages\do{%
+           \hv at typeout{>>>> Image loop: next=\next\space \hv at extern@fullPath}% 
            \expandafter\includegraphics\expandafter[\hv at extern@grfOptions,page=\next]%
-             {\hv at extern@ExamplesDir\hvExternDateiname}\hspace{\hv at extern@pagesep}}%
+             {\hv at extern@fullPath}\hspace{\hv at extern@pagesep}}%
          \hspace*{-\hv at extern@pagesep}%
        \fi
        \ifx\hv at extern@caption\@empty\else\caption{\hv at extern@caption}\fi
@@ -518,7 +572,7 @@
        \ifhv at extern@float
          \endfigure
        \else
-         \ifdim\hv at extern@mpwidth>\z@  \endminipage\else\par\endgroup\fi
+         \ifdim\hv at extern@mpwidth>\z@  \endminipage\else\unskip\strut\par\endgroup\fi
        \fi
      \fi
    \else% no graphic, only text
@@ -525,9 +579,9 @@
      \ifdim\hv at extern@mpwidth>\z@ 
        \hfill\minipage[t]{\dimexpr\linewidth-\hv at extern@mpwidth-\hv at extern@mpsep\relax}\vspace{0pt}
        \ifhv at extern@usefancyvrb
-         \expandafter\VerbatimInput\expandafter[\hv at extern@textOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}%
+         \expandafter\VerbatimInput\expandafter[\hv at extern@textOptions]{\hv at extern@fullPath.txt}%
        \else
-         \expandafter\lstinputlisting\expandafter[\hv at extern@textOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}%
+         \expandafter\lstinputlisting\expandafter[\hv at extern@textOptions]{\hv at extern@fullPath.txt}%
        \fi
        \endminipage
      \else
@@ -534,9 +588,9 @@
        \vspace{\hv at extern@belowbodyskip}
        \noindent
        \ifhv at extern@usefancyvrb
-         \expandafter\VerbatimInput\expandafter[\hv at extern@textOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}%
+         \expandafter\VerbatimInput\expandafter[\hv at extern@textOptions]{\hv at extern@fullPath.txt}%
        \else
-         \expandafter\lstinputlisting\expandafter[\hv at extern@textOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}%
+         \expandafter\lstinputlisting\expandafter[\hv at extern@textOptions]{\hv at extern@fullPath.txt}%
        \fi
      \fi
    \fi
@@ -548,6 +602,7 @@
   \begingroup
   \setkeys{hv}{code=false,includegraphic=false,#1}%
   \xdef\hvExternDateiname{#3-\arabic{hv at example@counter}}%
+  \xdef\hv at extern@fullPath{\hv at extern@ExamplesDir\hvExternDateiname}%
   \hv at typeout{>>>> running #2}%
   \ifhv at extern@redirect
     \ShellEscape{\hv at extern@progpath#2   > \hv at extern@ExamplesDir\hvExternDateiname.txt}%
@@ -573,13 +628,12 @@
          \begingroup
          \fboxsep=\hv at extern@framesep
          \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}}%
+           \fbox{\expandafter\includegraphics\expandafter[\hv at extern@grfOptions,page=\next]{\hv at extern@fullPath}}%
               \hspace{5pt}}\hspace*{-5pt}%
          \endgroup
        \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}%
+           \expandafter\includegraphics\expandafter[\hv at extern@grfOptions,page=\next]{\hv at extern@fullPath}%
               \hspace{5pt}}\hspace*{-5pt}%
        \fi
        \ifx\hv at extern@caption\@empty\else\caption{\hv at extern@caption}\fi
@@ -595,9 +649,9 @@
        \hv at typeout{>>>> Floating environment}% 
        \expandafter\figure\expandafter[!htb]
        \ifhv at extern@usefancyvrb
-         \expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+         \expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@fullPath.txt}
        \else     
-         \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+         \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@fullPath.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
@@ -605,9 +659,9 @@
      \else
        \noindent
        \ifhv at extern@usefancyvrb
-         \expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+         \expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@fullPath.txt}
        \else     
-         \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+         \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@fullPath.txt}
        \fi
      \fi
    \fi
@@ -616,7 +670,6 @@
 }
 
 \stepcounter{hv at example@counter}%
-
 %
 %%
 \endinput



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