texlive[68104] Master/texmf-dist: hvextern (30aug23)

commits+karl at tug.org commits+karl at tug.org
Wed Aug 30 01:20:30 CEST 2023


Revision: 68104
          http://tug.org/svn/texlive?view=revision&revision=68104
Author:   karl
Date:     2023-08-30 01:20:30 +0200 (Wed, 30 Aug 2023)
Log Message:
-----------
hvextern (30aug23)

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	2023-08-29 23:20:18 UTC (rev 68103)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/Changes	2023-08-29 23:20:30 UTC (rev 68104)
@@ -1,5 +1,6 @@
 hvextern.sty ----------------
 
+v 0.37 2023-08-29  - do not write files without --shell-escape
 v 0.36 2023-08-24  - added option "vshift" for inline objects
 v 0.35 2023-08-22  - fix shellesc option, don`t set it globally to true
 v 0.34 2023-07-05  - fix for missing --shell-escape option

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	2023-08-29 23:20:18 UTC (rev 68103)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex	2023-08-29 23:20:30 UTC (rev 68104)
@@ -1,16 +1,21 @@
-%% $Id: hvextern.tex 749 2023-08-24 19:10:17Z herbert $
-\RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+%% $Id: hvextern.tex 753 2023-08-29 07:22:20Z herbert $
+%\RequirePackage{pdfmanagement-testphase}
+\DocumentMetadata{}
 \documentclass[english,a4paper,twoside]{article}
 \usepackage{babel}
 \usepackage{libertinus}
 \setmonofont[Scale=MatchLowercase,FakeStretch=0.88]{AnonymousPro}
+\newfontfamily\NotoSansMono[Ligatures=TeX,Scale=MatchLowercase,
+	FakeStretch=0.90,Ligatures=ResetAll%,RawFeature=-tlig
+	]{Noto Sans Mono}
+\newfontfamily\CodeTwo{CODE2000}[Scale=MatchLowercase]
 \usepackage{iftex}
 
 \usepackage{fancyhdr}
 \pagestyle{fancy}
 \usepackage{hvlogos}
-\usepackage[checkCode]{hvextern}
+\usepackage%[checkCode]
+{hvextern}
 \usepackage{hvindex}
 \usepackage{hvdoctools}
 \usepackage{listings}
@@ -24,6 +29,8 @@
 \def\Java{\textsf{Java}\xspace}
 
 
+
+
 \begin{document}
 \title{Writing, running and including the output of external documents 
 from within a main\newline \LaTeX\ document~--v. \hvexternFileversion}
@@ -48,7 +55,7 @@
 
 There exists only one  option \Loption{checkCode} which is  valid
 for all \TeX-compiler. In this case an already existing  external file will only be compiled, if the
-external code changed. This dosn't depends on the setting of the option \Lkeyword{force}. 
+external code changed. This doesn't depends on the setting of the option \Lkeyword{force}. 
 \Loption{checkCode} can speed up the compilation time.
 
 \section{Syntax}
@@ -81,7 +88,6 @@
   with the \Loption{-shell-escape} command-line option, otherwise it won't
   work.  Follow-up runs, for example, to resolve references, should
   usually be done without \Loption{-shell-escape}.
-
 The currently used filename for the example is saved in the macro \Lcs{hvExternFilename}.
 
 \begin{verbatim}
@@ -88,9 +94,6 @@
 lualatex --shell-escape <file>
 \end{verbatim}
 
-
-
-
 The purpose for this package is to show the output of documents which have to be compiled with
 a different preamble or a different engine or a complete different system, but integrating the output
 automatically in the main document..
@@ -111,7 +114,7 @@
 which needs for several reasons a \XeLaTeX\ run. Instead of created and running a document 
 outside of the main document and then to insert the output
 we can do this from within this \LuaLaTeX\ document itself. The external document is compiled
-with \XeLaTeX\ and the output is insert as pdf image:\label{inline-exa}
+with \XeLaTeX\ and the output is insert as pdf image:
 \begin{externalDocument}[%
   compiler=xelatex, inline, force=true, runs=2, grfOptions={height=8pt},%
   crop, cropmargin=0, cleanup, docType=latex,vshift=-1pt]{voss}
@@ -121,8 +124,9 @@
 美好的一天.
 \end{document}
 \end{externalDocument}
+The current filename of the above example is \hvExternFilename\ and for the source 
+see page \pageref{inline-exa}.
 
-The current filename of the above example is \hvExternFilename.
 
 Let's show another example which needs a \pdfLaTeX\ run.  The \Index{source} code itself is also not
 shown by the environment \Lenv{externalDocument}.
@@ -317,7 +321,7 @@
 e.g. \texttt{shiftFN=5ex}. 
 
 
-\clearpage%%%%%%%%%%%%
+%\clearpage%%%%%%%%%%%%
 
 \begin{externalDocument}[grfOptions={width=0.95\linewidth},
   compiler=xelatex,code,mpwidth=0.6\linewidth,
@@ -1072,10 +1076,10 @@
 
 With the setting \LKeyset{inline=true} the optional keyword \Lkeyword{code}  and \Lkeyword{showFilename}
 is automatically set to false. The
-next  Chinese characters 
+next  Chinese characters \label{inline-exa}
 \begin{externalDocument}[
   compiler=xelatex, inline, runs=2, grfOptions={height=8pt},
-  crop, cropmargin=0, 
+  crop, cropmargin=0, vshift=-1pt,usefancyvrb,
   cleanup, force=true, docType=latex]{voss}%
 \documentclass{ctexart}
 \pagestyle{empty}
@@ -1086,11 +1090,12 @@
 are inserted as \Index{inline image} without showing the code. The complete code looks like:
 
 
+\let\myFont\CodeTwo
 
-\begin{Verbatim}
+\begin{Verbatim}[fontfamily=myFont]
 With \Lkeyset{inline} the optional argument \Lkeyword{code} is 
 automatically set to false. The next  Chinese characters 
-\begin{externalDocument}[
+\begin{externalDocument}[vshift=-1pt,
   compiler=xelatex, inline, runs=2, grfOptions={height=8pt},
   crop, cropmargin=0, cleanup, force=true, docType=latex]{voss}
 \documentclass{ctexart}
@@ -1103,6 +1108,7 @@
 code looks like:
 \end{Verbatim}
 
+With the keyword \Lkeyword{vshift} the inserted image can be moed in vertically direction.
 
 \subsection{Input text instead of an image}
 By default the created pdf which can be, of course, only text, will be inserted by \Lcs{includegraphics}.
@@ -1267,7 +1273,7 @@
   mpwidth=0.6\linewidth,
   usefancyvrb=false,
   docType=latex]{voss}
-\documentclass[paper=a6,DIV=18,parskip=half-]{screxa}
+\documentclass[paper=a6,DIV=18,parskip=half-]{scrartcl}
 \pagestyle{empty}
 \usepackage{libertinus}
 \setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase,FakeStretch=0.9]
@@ -1858,13 +1864,13 @@
 
 
 \begin{verbatim}
-\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\small}]{df}{voss}
+\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\small}]{du}{voss}% *nix
 \end{verbatim}
 
 
 
 \medskip
-\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\footnotesize}]{df}{voss}
+\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\small}]{du}{voss}
 
 
 
@@ -1883,8 +1889,10 @@
 if the package option \Loption{checkCode} exists.
 \item[\Lkeyword{cleanup}] the auxiliary files of a \LaTeX-run are deleted, preset to \texttt{aux}, \texttt{log}.
    It must be a comma seperated list of the extensions of the main file, s.g. \texttt{cleanup=\{aux,log\}}.
-\item[\Lkeyword{moveToExampleDir}] name of a directory for the examples, must first be created by the user himself
-\item[\Lkeyword{ExampleDir}] move all examples into a directory
+\item[\Lkeyword{moveToExampleDir}] move all examples into a directory, must be set \emph{before} the
+option \Lkeyword{ExampleDir}.
+\item[\Lkeyword{ExampleDir}] name of a directory for the examples, must 
+	first be created by the user himself.
 \item[\Lkeyset{tclbox=false}] Can be used if there are some negative interactions between package \Lpack{listings}
    and package \Lpack{tcolorbox}.
 \item[\Lkeyword{framesep}] Value for \Lcs{fbox} if keyword \texttt{frame} is used.

Modified: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	2023-08-29 23:20:18 UTC (rev 68103)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	2023-08-29 23:20:30 UTC (rev 68104)
@@ -1,4 +1,4 @@
-%% $Id: hvextern.sty 749 2023-08-24 19:10:17Z herbert $
+%% $Id: hvextern.sty 753 2023-08-29 07:22:20Z herbert $
 %% This is file `hvextern.sty',
 %%
 %% Copyright (C) 2016-23
@@ -12,8 +12,8 @@
 %% and version 1.3c or later is part of all distributions of LaTeX
 %% version 2005/12/01 or later.
 
-\def\hvexternFileversion{0.36}
-\ProvidesFile{hvextern}[2023/08/24 v\hvexternFileversion: package for running external documents (HV)]
+\def\hvexternFileversion{0.37}
+\ProvidesFile{hvextern}[2023/08/29 v\hvexternFileversion: package for running external documents (HV)]
 
 \newif\ifhv at extern@checkCode
 \hv at extern@checkCodefalse
@@ -21,7 +21,18 @@
 
 \ProcessOptions
 
-\RequirePackage{shellesc,xkeyval,graphicx}
+\RequirePackage{shellesc,xkeyval,graphicx,comment}
+
+\newif\ifhv at extern@shellescape  % the main command line option, for later test
+%\typeout{>>>> \the\ShellEscapeStatus}%
+\expandafter\ifnum\the\ShellEscapeStatus=1
+  \hv at extern@shellescapetrue
+  \typeout{>>>> command line option shell-escape is enabled!}%
+\else
+  \hv at extern@shellescapefalse
+  \typeout{>>>> command line option shell-escape is disabled!}%
+\fi
+
 \RequirePackage{fancyvrb,tikz,listings,ifplatform,iftex}
 \RequirePackage{ifoddpage,filemod}
 \RequirePackage{tcolorbox,xparse}
@@ -29,7 +40,6 @@
 
 \def\hv at ex@typeout#1{\ifhv at extern@verbose\typeout{>>(hvextern) #1}\fi}
 
-
 \ifwindows
   \def\hv at move{move }%
   \def\hv at rm{del }%
@@ -198,6 +208,7 @@
 
 \ResetKeys
 
+
 \ifhv at extern@checkCode
   \ifluatex
     \hv at ex@typeout{Loading hvextern.lua}%
@@ -442,13 +453,19 @@
    \expandafter\IfFileExists\expandafter{\hv at extern@ExamplesDir\hvExternFilename.pdf}{}{%  
      \expandafter\IfFileExists\expandafter{\hv at extern@ExamplesDir\hvExternFilename.png}{}{%
        \expandafter\IfFileExists\expandafter{\hv at extern@ExamplesDir\hvExternFilename.txt}{}{%
-         \global\hv at extern@forcetrue}}}%   set force, if no pdf or png exists
+         \global\hv at extern@forcetrue}}}%   set force, if no pdf or png or txt exists
    \begingroup
-   \hv at ex@typeout{writing file \hvExternFilename\hv at extern@ext ...}%
+   \ifhv at extern@shellescape
+     \hv at ex@typeout{writing file \hvExternFilename\hv at extern@ext ...}%
+   \else
+     \hv at ex@typeout{no shell-escape, no writing of file \hvExternFilename\hv at extern@ext}%
+     \let\filecontents\comment
+     \let\endfilecontents\endcomment
+   \fi
    \filecontents[force,noheader]{\hvExternFilename\hv at extern@ext}%
   }
-  {\endfilecontents%         \end%
-   \hv at ex@typeout{... done}%
+  {\endfilecontents
+   \ifhv at extern@shellescape\hv at ex@typeout{... done}\fi
    \global\stepcounter{hv at example@counter}%
    \endgroup
    \expandafter\hvExternSetKeys\expandafter{\hv at extern@savePara}%
@@ -691,10 +708,9 @@
        \fi
      \fi
   \fi%  end of \ifshowoutput
-  \ifhv at extern@force\expandafter\run at hv@extern at cleanup\expandafter{\hv at extern@cleanup}\fi%   cleanup
-  \hv at ex@typeout{Move source file into example dir, in case of missing --shell-escape}% 
-%  \hv at ex@typeout{\hvExternFilename ----> \hv at extern@ExamplesDir}%
-  \ShellEscape{\hv at move \hvExternFilename\hv at extern@ext\space \hv at extern@ExamplesDir}%
+  \ifhv at extern@force
+    \expandafter\run at hv@extern at cleanup\expandafter{\hv at extern@cleanup}%
+  \fi%   cleanup
   \vspace{\hv at extern@belowskip}%
 }
 



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