texlive[63140] Master: hvextern (25apr22)

commits+karl at tug.org commits+karl at tug.org
Mon Apr 25 22:27:47 CEST 2022


Revision: 63140
          http://tug.org/svn/texlive?view=revision&revision=63140
Author:   karl
Date:     2022-04-25 22:27:47 +0200 (Mon, 25 Apr 2022)
Log Message:
-----------
hvextern (25apr22)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/libexec/ctan2tds
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/hvextern/
    trunk/Master/texmf-dist/doc/latex/hvextern/Changes
    trunk/Master/texmf-dist/doc/latex/hvextern/README
    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/
    trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg
    trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg
    trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg
    trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg
    trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg
    trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg
    trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg
    trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
    trunk/Master/tlpkg/tlpsrc/hvextern.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/hvextern/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/Changes	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/Changes	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,4 @@
+hvextern.sty ----------------
+
+v 0.19 2022-04-23  first CTAN version
+

Added: trunk/Master/texmf-dist/doc/latex/hvextern/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/README	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,17 @@
+This package allows to write code in tex, latex, Perl, Lua, PYthon,
+and MetaPost into external files, run that code and insert the 
+output as pdf or png image or text.  Parts of the external code
+can be listed in the document. 
+The main LaTeX document must be run with the option --shell-escape
+
+
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+
+Herbert Voß, hvoss at tug.org
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/hvextern/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf	2022-04-25 20:23:46 UTC (rev 63139)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf	2022-04-25 20:27:47 UTC (rev 63140)

Property changes on: trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,1403 @@
+\RequirePackage{pdfmanagement-testphase}
+\DeclareDocumentMetadata{}
+\documentclass[ngerman,a4paper]{article}
+\usepackage{babel}
+\usepackage{libertinus}
+\setmonofont[Scale=MatchLowercase,FakeStretch=0.88]{AnonymousPro}
+\usepackage{iftex}
+
+\usepackage{hvlogos}
+\usepackage{hvextern}
+\usepackage{listings}
+\lstset{basicstyle=\ttfamily\small,language=[LaTeX]TeX,breaklines}
+\usepackage{xcolor}
+\begin{document}
+\title{Writing, running and including the output of external documents 
+from within a main \LaTeX\ document~--v. \hvexternFileversion}
+\author{Herbert Voß\thanks{herbert at dante.de}}
+\maketitle
+
+\tableofcontents
+
+\newpage
+
+\setkeys{hv}{moveToExampleDir,ExampleDir=Examples}
+\section{Syntax}
+
+\begin{verbatim}
+\usepackage{hvextern}
+\end{verbatim}
+
+\begin{sloppypar}
+This package allows to write external \MP, \TeX, \ConTeXt, \LaTeX, \LuaTeX, \LuaLaTeX, \XeTeX, \XeLaTeX, Lua, Perl and/or Python
+source code, which will then be run via \texttt{shell escape} to create a PDF oder text output to include
+it into the main \LaTeX\ document. 
+\end{sloppypar}
+
+
+There is only one environment:
+
+\begin{verbatim}
+\begin{externalDocument}[<options>]{<external filename without extension>}
+...
+source code
+...
+\end{externalDocument}
+\end{verbatim}
+
+The main document \emph{must} be run with the \texttt{-shell-escape} option, otherwise it won't work, e.g.:
+
+\begin{verbatim}
+laulatex --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..
+
+\section{First examples}
+\subsection{Without showing the code}
+
+This document was run with \LuaLaTeX. Suppose you want to insert the output of a document
+which needs for several reasons a \pdfLaTeX\ 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 \pdfLaTeX\ and the output is insert as pdf image. The source code itself is not
+shown by the environment \texttt{externalDocument}.
+
+
+\begin{minipage}{.59\linewidth}
+\begin{lstlisting}
+\begin{externalDocument}[
+  compiler=pdflatex,force,cleanup]{Roemer1}
+\documentclass{standalone}
+%StartVisiblePreamble
+\usepackage{fontenc}
+\usepackage{libertinus}
+\usepackage[linguistics]{forest}
+\forestapplylibrarydefaults{linguistics, edges}
+%StopVisiblePreamble
+\begin{document}
+\begin{forest}
+[VP
+  [DP]
+  [V’
+   [V]
+  [DP]
+  ]
+]
+\end{forest}
+\end{document}
+\end{externalDocument}
+\end{lstlisting}
+\end{minipage}
+\begin{minipage}{.39\linewidth}
+\begin{externalDocument}[
+  compiler=pdflatex,force,cleanup={log,aux},verbose]{Roemer1}
+\documentclass{standalone}
+%StartVisiblePreamble
+\usepackage{fontenc}
+\usepackage{libertinus}
+\usepackage[linguistics]{forest}
+\forestapplylibrarydefaults{linguistics, edges}
+%StopVisiblePreamble
+\begin{document}
+\begin{forest}
+[VP
+  [DP]
+  [V’
+   [V]
+  [DP]
+  ]
+]
+\end{forest}
+\end{document}
+\end{externalDocument}
+\end{minipage}
+
+\subsection{Showing code and output of a Python example}
+The png image  is created on the fly with the following arguments of \verb|externalDocument|:
+
+\begin{Verbatim}
+\begin{externalDocument}[
+  compiler=python3,
+  showFilename,
+  code,
+  ext=py,
+  docType=py,
+  usefancyvrb,
+  grfOptions={width=\linewidth}]{python}
+... Python code ...
+\end{externalDocument}
+\end{Verbatim}
+
+The code which is declared as header and main can be marked by:
+
+\begin{Verbatim}
+\extern at ExampleType{py}
+  {\NumChar StartVisibleMain}
+  {\NumChar StopVisibleMain}
+  {\NumChar StartVisiblePreamble}
+  {\NumChar StopVisiblePreamble}
+\end{Verbatim}
+
+\verb|\NumChar| is the default Python comment character \# and needs to be saved with a different
+catagory, which is done internally by the package. The complete definition of the code is:
+
+
+\begin{Verbatim}
+\begin{externalDocument}[
+  compiler=python3,
+  showFilename,
+  code,
+  ext=py,
+  force,
+  docType=py,
+  usefancyvrb,
+  grfOptions={width=\linewidth}]{python}
+import os
+#StartVisiblePreamble
+from PIL import Image
+import subprocess
+# drawing area (xa < xb and ya < yb)
+xa = -0.1716
+xb = -0.1433
+ya = 1.022
+yb = 1.044
+maxIt = 1024  # iterations
+imgx = 1000   # image size
+imgy = 750
+image = Image.new("RGB", (imgx, imgy))
+#StopVisiblePreamble
+
+#StartVisibleMain
+for y in range(imgy):
+    cy = y * (yb - ya) / (imgy - 1)  + ya
+    for x in range(imgx):
+        cx = x * (xb - xa) / (imgx - 1) + xa
+        c = complex(cx, cy)
+        z = 0
+        for i in range(maxIt):
+            if abs(z) > 2.0: break 
+            z = z * z + c 
+        r = i % 4 * 6
+        g = i % 8 * 32
+        b = i % 16 * 16
+        image.putpixel((x, y), b * 65536 + g * 256 + r)
+#StopVisibleMain
+# now get the filename created by the latex document
+imageName = os.path.basename(os.path.splitext(__file__)[0])+".png" # get filename
+image.save(imageName, "PNG")
+\end{externalDocument}
+\end{Verbatim}
+
+And with using this code we get the image as png inserted. The given filename of the external
+document is 
+internally extended by a consecutive number which isn't known to the Python code. However,
+it is no problem in any programming language to get the name of a running file. The  forlast
+line in the above code shows how it can be done with Python.
+
+
+\begin{externalDocument}[
+  compiler=python3,
+  progpath=/usr/local/bin/,
+  force,
+  showFilename,
+  runs=1,
+  code,
+  ext=py,
+  docType=py,
+  usefancyvrb,
+  grfOptions={width=\linewidth}]{python}
+import os
+#StartVisiblePreamble
+from PIL import Image
+import subprocess
+# drawing area (xa < xb and ya < yb)
+xa = -0.1716
+xb = -0.1433
+ya = 1.022
+yb = 1.044
+maxIt = 1024  # iterations
+imgx = 1000   # image size
+imgy = 750
+image = Image.new("RGB", (imgx, imgy))
+#StopVisiblePreamble
+
+#StartVisibleMain
+for y in range(imgy):
+    cy = y * (yb - ya) / (imgy - 1)  + ya
+    for x in range(imgx):
+        cx = x * (xb - xa) / (imgx - 1) + xa
+        c = complex(cx, cy)
+        z = 0
+        for i in range(maxIt):
+            if abs(z) > 2.0: break 
+            z = z * z + c 
+        r = i % 4 * 6
+        g = i % 8 * 32
+        b = i % 16 * 16
+        image.putpixel((x, y), b * 65536 + g * 256 + r)
+#StopVisibleMain
+# now get the filename created by the latex document
+imageName = os.path.basename(os.path.splitext(__file__)[0]) # get filename
+image.save(imageName+".png", "PNG")
+\end{externalDocument}
+
+
+
+
+
+
+
+\begin{externalDocument}[grfOptions={width=0.95\linewidth},
+  compiler=xelatex,code,mpwidth=0.6\linewidth,
+  crop,cleanup,force,usefancyvrb=false,ext=tex]{Senger3}
+\documentclass{article}
+%StartVisiblePreamble
+\usepackage{tikz}
+\usepackage[hks,pantone,xcolor]{xespotcolor}
+%StopVisiblePreamble
+\pagestyle{empty}
+\begin{document}
+\SetPageColorSpace{HKS}
+\definecolor{HYellow}{spotcolor}{HKS05N,0.5}
+\definecolor{HRed}{spotcolor}{HKS14N,0.5}
+\definecolor{HBlue}{spotcolor}{HKS38N,0.5}
+\begin{tikzpicture}[scale=0.7,fill opacity=0.7]
+ \fill[HYellow]( 90:1.2) circle (2);
+ \fill[HRed]   (210:1.2) circle (2);
+ \fill[HBlue]  (330:1.2) circle (2);
+ \node at ( 90:2)  {Typography};
+ \node at ( 210:2) {Design};
+ \node at ( 330:2) {Coding};
+ \node {\LaTeX};
+\end{tikzpicture}
+\end{document}
+\end{externalDocument}
+
+
+\section{Setting marker in the source}
+The marker for the code ranges which should be listed depend to the used programming language:
+
+\begin{verbatim}
+[...]
+%StartVisiblePreamble
+[... listed preamble code ]
+%StopVisiblePreamble
+[...]
+\begin{document}
+[...]
+\end{document}
+\end{verbatim}
+
+everything between \verb|%StartVisiblePreamble| and \verb|%StopVisiblePreamble| will be listed as
+preamble and in case of a \LaTeX\ source everything between
+ \verb|\begin{document}| and \verb|\end{document}| as body. The marker must be defined in an own
+ config file, e.g. \texttt{hv-extern-py.cfg}:
+ 
+\begin{verbatim}
+\extern at ExampleType{py}
+  {\NumChar StartVisibleMain}
+  {\NumChar StopVisibleMain}
+  {\NumChar StartVisiblePreamble}
+  {\NumChar StopVisiblePreamble}
+\end{verbatim}
+ 
+\verb|\NumChar| is the comment character \#, which needs a special handling. This version of \texttt{hvextern}
+supports the following programming languages (option \texttt{compiler}):
+mpost, tex, latex, luatex, python3, perl, lua, xetex, pdflatex, lualatex, xelatex, and context. The default
+is pdflatex. The option \texttt{docType} selects the config file, which must be one of 
+context, lua, pl, tex, latex, mp, and py. For Lua it is
+
+\begin{verbatim}
+\extern at ExampleType{lua}
+  {--StartVisibleMain}
+  {--StopVisibleMain}
+  {--StartVisiblePreamble}
+  {--StopVisiblePreamble}
+\end{verbatim}
+
+
+It defines the marker strings for the listed code sequences.  In some cases you have to use multiple times the same value
+for different optional arguments, e.g.
+
+\begin{verbatim}
+ext=lua, compiler=lua, docType=lua, ... 
+\end{verbatim}
+
+
+\section{Optional arguments}
+The deafault setting is always shown in brackets. 
+\subsection{Programs and runs}
+
+The \texttt{progpath} should only in some
+rare cases needed. In general all used compilers will be found by the system. A given \texttt{progpath}
+must be end with a slash, e.g. \texttt{./bin/} The option \texttt{runsequence} is currently not used.
+
+\begin{verbatim}
+\define at key{hv}{progpath}[]{\def\hv at extern@progpath{#1}}
+\define at key{hv}{compiler}[pdflatex]{\def\hv at extern@compiler{#1}}
+\define at key{hv}{runsequence}[]{\def\hv at extern@runsequence{#1}}
+\define at key{hv}{runs}[1]{\setcounter{hv at extern@runs}{#1}}
+\end{verbatim}
+
+\subsection{Grafik options}
+\begin{verbatim}
+\define at key{hv}{grfOptions}[]{\def\hv at extern@grfOptions{#1}}
+\end{verbatim}
+
+The option is passed to \verb|\includegraphics|, e.g. \verb|angle=90,width=\linewidth| for
+the follwing example.
+
+\begin{externalDocument}[grfOptions={angle=90,width=\linewidth},
+  compiler=xelatex,code,mpwidth=0.6\linewidth,
+  crop,cleanup,force]{Senger3}
+\documentclass{article}
+%StartVisiblePreamble
+\usepackage{tikz}
+\usepackage[hks,pantone,xcolor]{xespotcolor}
+%StopVisiblePreamble
+\pagestyle{empty}
+\begin{document}
+\SetPageColorSpace{HKS}
+\definecolor{HYellow}{spotcolor}{HKS05N,0.5}
+\definecolor{HRed}{spotcolor}{HKS14N,0.5}
+\definecolor{HBlue}{spotcolor}{HKS38N,0.5}
+\begin{tikzpicture}[scale=0.7,fill opacity=0.7]
+ \fill[HYellow]   ( 90:1.2) circle (2);
+ \fill[HRed] (210:1.2) circle (2);
+ \fill[HBlue]  (330:1.2) circle (2);
+ \node at ( 90:2) {Typography};
+ \node at ( 210:2) {Design};
+ \node at ( 330:2) {Coding};
+ \node {\LaTeX};
+\end{tikzpicture}
+\end{document}
+\end{externalDocument}
+
+
+\subsection{Listings options}
+
+\begin{verbatim}
+\define at key{hv}{lstOptions}[]{\def\hv at extern@lstOptions{#1}}
+\end{verbatim}
+
+The option is passed either to \verb|\lstinputlisting|, or, if \texttt{usefancyvrb} is active, 
+to \verb|\VerbatimInput|. The following example uses 
+
+\begin{verbatim}
+  lstOptions={basicstyle=\sffamily\itshape\scriptsize},
+\end{verbatim}
+
+
+
+\begin{externalDocument}[
+  grfOptions={width=\linewidth},
+  lstOptions={basicstyle=\sffamily\itshape\scriptsize},
+  compiler=lualatex,
+  code,
+  mpwidth=0.6\linewidth,
+  crop,
+  cleanup,
+  force,
+  docType=latex]{voss}
+\RequirePackage{pdfmanagement-testphase}
+\DeclareDocumentMetadata{}
+\documentclass{article}
+%StartVisiblePreamble
+\usepackage{pst-calendar} 
+%StopVisiblePreamble
+\pagestyle{empty}
+\begin{document}
+\psscalebox{0.3}{%
+  \psCalDodecaeder[Year=2022,style=april]%
+}
+\end{document}
+\end{externalDocument}
+
+\subsection{Background color}
+
+There are different colors for the preamble and body listing: the backgrund and frame color.
+\begin{verbatim}
+\define at key{hv}{BGpreamble}[black12]{\def\hv at extern@BGpreamble{#1}}
+\define at key{hv}{BGbody}[black8]{\def\hv at extern@BGbody{#1}}
+\define at key{hv}{BOpreamble}[black12]{\def\hv at extern@BOpreamble{#1}}
+\define at key{hv}{BObody}[black8]{\def\hv at extern@BObody{#1}}
+\end{verbatim}
+
+The options are passed to \verb|tcolorbox| and preset to \texttt{black12} and \texttt{black!8}.
+The color of the frame is set to the same values, hence not seen. The following example uses
+
+\begin{verbatim}
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+\end{verbatim}
+
+%\clearpage
+
+\begin{externalDocument}[
+  grfOptions={width=\linewidth},
+  lstOptions={fontsize=\small,fontfamily=tt},
+  compiler=lualatex,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+  mpwidth=0.6\linewidth,
+  crop,
+  cleanup,
+  force,
+  usefancyvrb,
+  docType=latex]{voss}
+\RequirePackage{pdfmanagement-testphase}
+\DeclareDocumentMetadata{}
+\documentclass{article}
+%StartVisiblePreamble
+\usepackage{pst-calendar} 
+%StopVisiblePreamble
+\pagestyle{empty}
+\begin{document}
+\psscalebox{0.3}{%
+  \psCalDodecaeder[Year=2022,style=may]%
+}
+\end{document}
+\end{externalDocument}
+
+\subsection{Type of the source code}
+
+The current version of \texttt{hvextern} supports code written as
+\MP, \plainTeX, \LaTeX, \ConTeXt, and Python. Every type has its own config file which
+defines the keywords for the linerange which should be printed for the preamble and
+the body. For example the \texttt{latex} config file \texttt{hvextern-latex,cfg}:
+
+\begin{verbatim}
+\extern at ExampleType{latex}%                   for _all_LaTeX engines   
+  {\string\begin\string{document\string}}%       
+  {\string\end\string{document\string}}%         
+  {\perCent StartVisiblePreamble}%               
+  {\perCent StopVisiblePreamble}%                
+
+% only for the sequence latex->dvips->ps2pdf
+\def\hv at extern@runLATEX#1#2#3#4{% path compiler file extension  
+  \ifhv at extern@verbose \typeout{>>>> running #1#2 #3#4}\fi
+  \ShellEscape{#1#2\space #3#4}%
+  \ifhv at extern@verbose \typeout{>>>> running #1dvips #3}\fi
+  \ShellEscape{#1dvips\space #3.dvi}%
+  \ifhv at extern@verbose \typeout{>>>> running ps2pdf #3.ps}\fi
+  \ShellEscape{#1ps2pdf\space -dAutoRotatePages=/None\space -dALLOWPSTRANSPARENCY\space  #3.ps}%
+}
+\end{verbatim}
+
+If a source needs more than running the defined compiler, it must be defined by a macro
+\begin{verbatim}
+\def\hv at extern@run<NAME>#1#2#3#4{% path compiler file extension
+...}
+\end{verbatim}
+
+The type of the source code can be different to the compiler, e.g. source \texttt{latex},
+but compiler \texttt{lualatex}.
+
+
+\subsection{Output as floating object with caption and label}
+
+By default the images are not inserted as a float. This can be changed by
+the keyword \texttt{float}, a caption and a label are optional. The float type is always
+\texttt{figure}.
+
+\begin{verbatim}
+\define at boolkey{hv}[hv at extern@]{float}[true]{}
+\define at key{hv}{caption}[]{\def\hv at extern@caption{#1}}
+\define at key{hv}{label}[]{\def\hv at extern@label{#1}}
+\end{verbatim}
+
+The image Figure~\ref{img:cox} shows an example for a floting object.
+
+\begin{externalDocument}[
+  grfOptions={width=\linewidth},
+  lstOptions={fontsize=\small,fontfamily=tt},
+%  lstOptions={basicstyle=\small\ttfamily},
+  compiler=lualatex,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+%  mpwidth=0.6\linewidth,
+  crop,
+  cleanup,
+  force,
+  usefancyvrb,
+  float,
+  caption={An example for Coxeter images},
+  label=img:cox,
+  docType=latex]{voss}
+\RequirePackage{pdfmanagement-testphase}
+\DeclareDocumentMetadata{}
+\documentclass{article}
+%StartVisiblePreamble
+\usepackage{pst-coxeterp} 
+%StopVisiblePreamble
+\pagestyle{empty}
+\begin{document}
+\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=2]\end{pspicture}
+%
+\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=3]\end{pspicture}
+%
+\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=5]\end{pspicture}
+%
+\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=7]\end{pspicture}
+%
+% ------------------------------------
+% Only some text to show the pagebreak
+% ------------------------------------
+\end{document}
+\end{externalDocument}
+
+
+
+
+\subsection{Output more than one page}
+The pages which should be printed can be defined by
+
+
+\begin{verbatim}
+\define at key{hv}{pages}[1]{\def\hv at extern@pages{#1}}
+\define at boolkey{hv}[hv at extern@]{frame}[true]{}
+\end{verbatim}
+
+With \texttt{frame} the pages can be framed (internally by \verb|\fbox|).
+It is leaved to the user to choose the correct image width for the pages.
+The following example uses:
+
+\begin{verbatim}
+  pages={1,2,3},
+  grfOptions={width=0.3\linewidth},
+  compiler=lualatex, runs=2,  % for the TOC
+  frame,
+\end{verbatim}
+
+\begin{externalDocument}[
+  pages={1,2,3},
+  grfOptions={width=0.3\linewidth},
+%  lstOptions={fontsize=\small,fontfamily=tt},
+  compiler=lualatex, runs=2,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+%  mpwidth=0.6\linewidth,
+%  crop,
+  cleanup,
+  force,
+  frame,
+%  usefancyvrb,
+%  float,
+%  caption={An example for Coxeter images},
+%  label=img:cox,
+  docType=latex]{voss}
+\documentclass{article}
+%StartVisiblePreamble
+\usepackage[american]{babel}
+\usepackage{libertinus} 
+\usepackage{blindtext} 
+%StopVisiblePreamble
+\pagestyle{empty}
+\begin{document}
+\title{A multipage example}
+\author{Erasmus von Rotterdam}
+\maketitle
+\tableofcontents
+\blinddocument
+\end{document}
+\end{externalDocument}
+
+
+
+\subsection{Cropping the PDF}
+Instead of using the documentclass \texttt{standalone}, which already crops the created PDF,
+one can use the optional argument \texttt{crop}.
+
+\begin{verbatim}
+\define at boolkey{hv}[hv at extern@]{crop}[true]{}
+\define at key{hv}{cropmargin}[2]{\def\hv at extern@cropmargin{#1 }}% length in pt
+\end{verbatim}
+
+
+It is also possible to crop a document with more than one page. In this case the
+beginning and end of the pages should be on the same height. Otherwise the pages
+will have different heights after cropping (see next image). The follwoing example was created with
+
+\begin{verbatim}
+  pages={1,2,3},
+  grfOptions={width=0.3\linewidth},
+  compiler=lualatex, runs=2,  % for the TOC
+  frame,
+  crop, cropmargin=5,%    5pt margin
+\end{verbatim}
+
+\begin{externalDocument}[
+  pages={1,2,3},
+  grfOptions={width=0.3\linewidth},
+%  lstOptions={fontsize=\small,fontfamily=tt},
+  compiler=lualatex, runs=2,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+%  mpwidth=0.6\linewidth,
+  crop, cropmargin=5,
+  cleanup,
+  force,
+  frame,
+%  usefancyvrb,
+%  float,
+%  caption={An example for Coxeter images},
+%  label=img:cox,
+  docType=latex]{voss}
+\documentclass{article}
+%StartVisiblePreamble
+\usepackage[american]{babel}
+\usepackage{libertinus} 
+\usepackage{blindtext} 
+\pagestyle{headings}
+%StopVisiblePreamble
+\begin{document}
+\title{A multipage example}
+\author{Erasmus von Rotterdam}
+\maketitle
+\tableofcontents
+\Blinddocument
+\end{document}
+\end{externalDocument}
+
+
+\subsection{Code and output side by side}
+By default the code and the output is on top of each other. With setting the
+width of a minipage with \texttt{mpwidth} greater than 0\,pt  the output will be side by side.
+
+\begin{verbatim}
+\define at key{hv}{mpwidth}[0pt]{\setlength\hv at extern@mpwidth{#1}}
+\end{verbatim}
+
+\texttt{mpwidth} is  the width of the code. The rest of the line, minus 1em for the space between
+the minipages, will be the possible
+width for the output and will be calculated automatically. The two minipages are
+aligned by its top.
+
+
+
+\subsection{Align of the output}
+
+%\begin{verbatim}
+%\define at key{hv}{align}[\centering]{\def\hv at extern@align{#1}}
+%\end{verbatim}
+
+\subsubsection{the default}
+
+\begin{verbatim}
+  align=\centering,
+\end{verbatim}
+
+\begin{externalDocument}[
+  compiler=lualatex, runs=2,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+  crop,
+  cleanup,
+  force,
+  docType=latex]{voss}
+\documentclass{article}
+\pagestyle{empty}
+\begin{document}
+\rule{0.5\linewidth}{5mm}
+\end{document}
+\end{externalDocument}
+
+\subsubsection{Left aligned}
+
+\begin{verbatim}
+  align=\raggedright,
+\end{verbatim}
+
+\begin{externalDocument}[
+  align=\raggedright,
+  compiler=lualatex, runs=2,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+  crop,
+  cleanup,
+  force,
+  docType=latex]{voss}
+\documentclass{article}
+\pagestyle{empty}
+\begin{document}
+\rule{0.5\linewidth}{5mm}
+\end{document}
+\end{externalDocument}
+
+\subsubsection{Right aligned}
+
+\begin{verbatim}
+  align=\raggedleft,
+\end{verbatim}
+
+
+\begin{externalDocument}[
+  align=\raggedleft,
+  compiler=lualatex, runs=2,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+  crop,
+  cleanup,
+  force,
+  docType=latex]{voss}
+\documentclass{article}
+\pagestyle{empty}
+\begin{document}
+\rule{0.5\linewidth}{5mm}
+\end{document}
+\end{externalDocument}
+
+
+%Now the same for side by side output.
+
+\subsubsection{the default -- side by side}
+\begin{verbatim}
+  align=\centering,  mpwidth=0.5\linewidth,
+\end{verbatim}
+
+\begin{externalDocument}[
+  compiler=lualatex, runs=2,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+  crop,
+  cleanup,
+  force,
+  mpwidth=0.5\linewidth,
+  docType=latex]{voss}
+\documentclass{article}
+\pagestyle{empty}
+\begin{document}
+\rule{0.25\linewidth}{5mm}
+\end{document}
+\end{externalDocument}
+
+\subsubsection{Left aligned -- side by side}
+
+\begin{verbatim}
+  align=\raggedright,   mpwidth=0.5\linewidth,
+\end{verbatim}
+
+\begin{externalDocument}[
+  align=\raggedright,
+  compiler=lualatex, runs=2,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+  crop,
+  cleanup,
+  force,
+  mpwidth=0.5\linewidth,
+  docType=latex]{voss}
+\documentclass{article}
+\pagestyle{empty}
+\begin{document}
+\rule{0.25\linewidth}{5mm}
+\end{document}
+\end{externalDocument}
+
+\subsubsection{Right aligned -- side by side}
+
+\begin{verbatim}
+  align=\raggedleft,  mpwidth=0.5\linewidth,
+\end{verbatim}
+
+
+\begin{externalDocument}[
+  align=\raggedleft,
+  compiler=lualatex, runs=2,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+  crop,
+  cleanup,
+  force,
+  mpwidth=0.5\linewidth,
+  docType=latex]{voss}
+\documentclass{article}
+\pagestyle{empty}
+\begin{document}
+\rule{0.25\linewidth}{5mm}
+\end{document}
+\end{externalDocument}
+
+\subsection{Inline images}
+By default code and image are own paragraphs. With the optional argument \texttt{inline} the created
+image can be part of the current line. This may make sense, if you need characters which are
+not part of your current font.
+
+\begin{verbatim}
+\define at boolkey{hv}[hv at extern@]{inline}[true]{\hv at extern@codefalse}
+\end{verbatim}
+
+With \texttt{inline=true} the optional argument \texttt{code} is automatically set to false. The
+next  Chinese characters 
+\begin{externalDocument}[
+  compiler=xelatex, inline, runs=2, grfOptions={height=8pt},
+  crop, cropmargin=0, cleanup, force, docType=latex]{voss}%
+\documentclass{ctexart}
+\pagestyle{empty}
+\begin{document}
+美好的一天
+\end{document}
+\end{externalDocument}
+are inserted as inline image without showing the code. The complete code looks like:
+
+
+
+\begin{Verbatim}
+With \texttt{inline=true} the optional argument \texttt{code} is automatically set to false. The
+next  Chinese characters 
+\begin{externalDocument}[
+  compiler=xelatex, inline, runs=2, grfOptions={height=8pt},
+  crop, cropmargin=0, cleanup, force, docType=latex]{voss}
+\documentclass{ctexart}
+\pagestyle{empty}
+\begin{document}
+美好的一天
+\end{document}
+\end{externalDocument}
+are inserted as inline image without showing the code. The complete code looks like:
+\end{Verbatim}
+
+
+\subsection{Input text instead of an image}
+By default the created pdf which can be, of course, only test, wil be insert by \verb|\incudegraphics|.
+If you have only text as output and dont want to create a pdf you can insert this kind of
+output as verbatim text by setting \verb|includegraphic=false|. 
+
+\begin{verbatim}
+\define at boolkey{hv}[hv at extern@]{includegraphic}[true]{}
+\end{verbatim}
+
+
+The textfile must have the same main filename with the extension
+\verb|.txt|. As already mentioned, in every programming language you can get the current
+used filename from within the code itself. The following Perl example which calculates the
+Kaprekar constants uses 
+
+\begin{verbatim}
+my $filename = $0;             # the current filename
+$filename =~ s/\.pl//;         # without extension .pl
+$filename = "${filename}.txt"; # for the output
+\end{verbatim}
+
+Only for some completeness: a Kaprekar constant is a number $A$ with $\max(A)-\min(A)=A$. $\max$ and $\min$ are the
+sorted digits of the number $A$: $495=954-459$.
+
+
+\begin{externalDocument}[
+  compiler=perl, force, docType=pl, ext=pl, includegraphic=false,
+  code, mpwidth=0.6\linewidth]{voss}
+#!/usr/bin/perl
+#
+# Herbert Voss 2005-05-31
+#
+#StartVisiblePreamble
+my $zahl = 1;
+my $anfang = 1;
+my $ende = 9;
+#StopVisiblePreamble
+my $filename = $0;             # the current filename
+$filename =~ s/\.pl//;         # without extension .pl
+$filename = "${filename}.txt"; # for the output
+my $found = 0;
+open(my $fh, '>', $filename);
+
+#StartVisibleMain
+print $fh "Finding Kaprekarconstants ...\n";
+while ($zahl < 8) {
+  print $fh "${zahl}-stellig: ";
+  foreach ($anfang...$ende) { # for every row $_
+    @Zeichen = split(//,$_);
+    $Min = join("",sort(@Zeichen));
+    $Max = reverse($Min);
+    $Dif=$Max-$Min;
+    if($_ eq $Dif) {
+      $found = 1;
+      print $fh $_,",  ";
+    }
+  }
+  if (!$found) { print $fh "---\n"; }
+  else         { print $fh "\n";    }
+  $found = false;
+  $zahl = $zahl+1;
+  $anfang = $anfang*10;
+  $ende = $ende*10;
+}
+#StopVisibleMain
+close $fh;
+\end{externalDocument}
+
+
+%$
+Another example with running Lua to calculate and print the Pascal's triangle. The internal filename
+is available with
+
+\begin{verbatim}
+local filename = arg[0]
+local shortFN = str:match("(.+)%..+")   -- delete extension
+outFile = io.open(shortFN..".txt","w+") -- open external file
+\end{verbatim}
+
+
+\begin{externalDocument}[
+  compiler=lua, force, docType=lua, ext=lua, includegraphic=false, code, usefancyvrb=false]{voss}
+#!/usr/bin/env lua
+local filename = arg[0]
+local shortFN = filename:match("(.+)%..+")
+outFile = io.open(shortFN..".txt","w+")
+
+--StartVisiblePreamble
+function nextrow(t)
+  local ret = {}
+  t[0], t[#t+1] = 0, 0
+  for i = 1, #t do ret[i] = t[i-1] + t[i] end
+  return ret
+end
+
+function triangle(n)
+  t = {1}
+  for i = 1, n do
+    m = (n - i)
+    for j = 1,m do outFile:write("    ") end
+    for k = 1,i do outFile:write(string.format("%8s",t[k])) end
+    outFile:write("\n")
+    t = nextrow(t)
+  end
+end
+--StopVisiblePreamble
+
+--StartVisibleMain
+triangle(10)
+--StopVisibleMain
+outFile:close()
+\end{externalDocument}
+
+
+
+
+
+
+\subsection{Running additional external programs}
+
+For a \LaTeX\ additional programs for bibliography, index, a.s.o. maybe needed.
+
+\begin{verbatim}
+\define at boolkey{hv}[hv at extern@]{biber}[true]{}
+\define at boolkey{hv}[hv at extern@]{xindex}[true]{}
+\define at key{hv}{xindexOptions}[]{\def\hv at extern@xindexOptions{#1}}
+\end{verbatim}
+
+The \texttt{biber} run needs no additional options, but for \texttt{xindex} it maybe useful.
+The following examples uses
+
+\begin{verbatim}
+\begin{externalDocument}[
+  compiler=lualatex, runs=2,
+  pages=2,
+  crop,
+  xindex,
+  xindexOptions={-l DE --config AU},
+  mpwidth=0.6\linewidth,
+  usefancyvrb=false,
+  docType=latex,
+  ...
+]{voss}
+\end{verbatim}
+
+
+
+
+\begin{externalDocument}[
+  grfOptions={scale=0.75},
+  compiler=lualatex, runs=2,
+  BGpreamble=red!10, BOpreamble=red, 
+  BGbody=blue!8, BObody=blue,
+  code,
+  pages=2,
+  crop,
+  cleanup,
+  force,
+  xindex,
+  xindexOptions={-l DE --config AU},
+  mpwidth=0.6\linewidth,
+  usefancyvrb=false,
+  docType=latex]{voss}
+\documentclass[paper=a6,DIV=18,parskip=half-]{screxa}
+\pagestyle{empty}
+\usepackage{libertinus}
+\setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase,FakeStretch=0.9]
+\usepackage[ngerman]{babel}
+\usepackage{multicol}
+\makeatletter
+\def\theindex{%    only for demonstration
+  \newpage
+  \section*{\indexname}
+  \begin{multicols}{2}
+  \parskip\z@ \@plus .3\p@\relax \parindent\z@
+  \let\item\@idxitem}
+\def\endtheindex{\end{multicols}}
+\makeatother
+%StartVisiblePreamble
+\usepackage{makeidx}\makeindex
+\usepackage{hvindex}
+%StopVisiblePreamble
+\begin{document}
+Sort with xindex \verb|-l DE --config AU|
+\Index{Österreich} \Index{Öresund} 
+\Index{Ostern} \Index{Ober} \Index{Oberin} 
+\Index{Österreich} \Index{Öresund} 
+\Index{Ödem} \Index{Oligarch} \Index{Oder} 
+\Index{Ostern} \Index{Ober} \Index{Oberin} 
+\Index{Obstler} \Index{Öl} \Index{ölen} 
+\Index{Oder|seealso{Fluss}} \Index{Göbel}
+\Index{oder} \index{Fluss!Oder}
+\Index{Goethe} \Index{Göthe} \Index{Götz}
+\Index{Goldmann}
+\printindex
+\end{document}
+\end{externalDocument}
+
+
+
+
+
+
+
+\subsection{Using \texttt{listings}}
+The default is using \verb|\lstinputlisting| for the printed code sequences.
+
+\begin{externalDocument}[
+  grfOptions={width=0.45\linewidth},
+  pages={1,3},
+  frame,compiler=pdflatex,
+  showFilename,
+%  crop,
+  force,runs=2,code,docType=latex,
+  frame,
+  lstOptions={columns=fixed}]{Schubert-A}
+%StartVisiblePreamble
+\documentclass[chapterprefix=on,parskip=half-,DIV=12,fontsize=12pt]{scrbook}
+\DeclareNewSectionCommand[
+  style=section,
+  level=4,
+  beforeskip=-3.25ex plus -1ex minus -.2ex,
+  afterskip=1.5ex plus .2ex,
+  font=\normalsize,
+  indent=0pt,
+  counterwithin=subsubsection
+]{subsubsubsection}
+\RedeclareSectionCommand[
+  level=5,
+  toclevel=5,
+  tocindent=13em,
+  tocnumwidth=5.9em,
+  counterwithin=subsubsubsection
+]{paragraph}
+\RedeclareSectionCommand[
+  level=6,
+  toclevel=6,
+  tocindent=15em,
+  tocnumwidth=6.8em
+]{subparagraph}
+\setcounter{secnumdepth}{\subsubsubsectionnumdepth}
+\setcounter{tocdepth}{\subsubsubsectiontocdepth}
+%StopVisiblePreamble
+\usepackage[ngerman]{babel}
+\usepackage{libertinus}
+\usepackage{blindtext}
+\begin{document}
+\tableofcontents
+\chapter{Einführung}
+\section{Ein Abschnitt}
+\subsection{Ein Unterabschnitt}
+\subsubsection{Ein Unter-Unterabschnitt}
+\subsubsubsection{Ein Unter-Unter-Unterabschnitt}
+\paragraph{Der normale Paragraph}
+\blindtext
+\subparagraph{Der normale Unterparagraph}
+\blindtext
+\blinddocument
+\end{document}
+\end{externalDocument}
+
+
+
+It also possible to use \verb|\VerbatimInput| from package \texttt{fancyvrb}. In general
+it makes no difference using the optional argument \texttt{usefancyvrb} or not.
+
+
+\begin{externalDocument}[
+  grfOptions={width=0.45\linewidth},
+  pages={1,3},
+  frame,compiler=pdflatex,
+  showFilename,
+%  crop,
+  force,runs=2,code,docType=latex,
+  frame,usefancyvrb]{Schubert-A}
+%StartVisiblePreamble
+\documentclass[chapterprefix=on,parskip=half-,DIV=12,fontsize=12pt]{scrbook}
+\DeclareNewSectionCommand[
+  style=section,
+  level=4,
+  beforeskip=-3.25ex plus -1ex minus -.2ex,
+  afterskip=1.5ex plus .2ex,
+  font=\normalsize,
+  indent=0pt,
+  counterwithin=subsubsection
+]{subsubsubsection}
+\RedeclareSectionCommand[
+  level=5,
+  toclevel=5,
+  tocindent=13em,
+  tocnumwidth=5.9em,
+  counterwithin=subsubsubsection
+]{paragraph}
+\RedeclareSectionCommand[
+  level=6,
+  toclevel=6,
+  tocindent=15em,
+  tocnumwidth=6.8em
+]{subparagraph}
+\setcounter{secnumdepth}{\subsubsubsectionnumdepth}
+\setcounter{tocdepth}{\subsubsubsectiontocdepth}
+%StopVisiblePreamble
+\usepackage[ngerman]{babel}
+\usepackage{libertinus}
+\usepackage{blindtext}
+\begin{document}
+\tableofcontents
+\chapter{Einführung}
+\section{Ein Abschnitt}
+\subsection{Ein Unterabschnitt}
+\subsubsection{Ein Unter-Unterabschnitt}
+\subsubsubsection{Ein Unter-Unter-Unterabschnitt}
+\paragraph{Der normale Paragraph}
+\blindtext
+\subparagraph{Der normale Unterparagraph}
+\blindtext
+\blinddocument
+\end{document}
+\end{externalDocument}
+
+
+
+\section{Supported engines}
+\subsection{\MP\ example}
+
+\begin{externalDocument}[
+%  grfOptions={width=0.45\linewidth},
+%  pages={1,3},
+  frame,
+  verbose=false,
+  compiler=mpost,
+  showFilename,
+%  crop,
+  force,
+  code,
+  docType=mp,
+  ext=mp,]{voss}
+%StartVisiblePreamble
+defaultfont:="ptmr8r";
+warningcheck:=0;
+%StopVisiblePreamble
+beginfig(1)
+draw fullcircle shifted (0.5,0.6) xscaled 8cm yscaled 3.5cm 
+  withpen pencircle scaled 5bp withcolor red;
+special( " /Times-Roman findfont 150 scalefont setfont " &
+  " 0 10 moveto (MPost) false charpath clip stroke gsave 150 70 translate " &
+  " 2 4 600 {dup 0 moveto 0 exch 0 exch 0 360 arc stroke} for grestore ");
+endfig;
+end;
+\end{externalDocument}
+
+
+
+
+\subsection{plain\TeX\ example}
+
+\begin{externalDocument}[
+  grfOptions={width=0.5\linewidth},
+%  pages={1,3},
+  frame,
+  verbose=false,
+  compiler=tex,
+  showFilename,
+%  crop,
+  force,
+  code,
+  docType=tex,
+  ext=tex,]{voss}
+\magnification=\magstep1
+\baselineskip=12pt
+\hsize=6.3truein
+\vsize=8.7truein
+\font\footsc=cmcsc10 at 8truept
+\font\footbf=cmbx10 at 8truept
+\font\footrm=cmr10 at 10truept
+%StartVisiblePreamble
+\footline={\footsc the electronic journal of combinatorics
+   {\footbf 16} (2009), \#R00\hfil\footrm\folio}
+%StopVisiblePreamble
+%StartBody
+\font\bigrm=cmr12 at 14pt
+\centerline{\bigrm An elementary proof of the reconstruction conjecture}
+
+\bigskip\bigskip
+\centerline{D. Remifa\footnote*{Thanks to the editors of this journal!}}
+\smallskip
+\centerline{Department of Inconsequential Studies}
+\centerline{Solatido College, North Kentucky, USA}
+\centerline{\tt remifa at dis.solatido.edu}
+\bigskip
+\centerline{\footrm 
+Submitted: Jan 1, 2009; Accepted: Jan 2, 2009; Published: Jan 3, 2009}
+\centerline{\footrm Mathematics Subject Classifications: 05C88, 05C89}
+\bigskip\bigskip
+\centerline{\bf Abstract}
+\smallskip
+{\narrower\noindent
+The reconstruction conjecture states that the multiset of unlabeled
+vertex-deleted subgraphs of a graph determines the graph, provided it
+has at least 3 vertices.  A version of the problem was first stated
+by Stanis\l aw Ulam.  In this paper, we show that the conjecture can
+be proved by elementary methods.  It is only necessary to integrate
+the Lenkle potential of the Broglington manifold over the quantum
+supervacillatory measure in order to reduce the set of possible
+counterexamples to a small number (less than a trillion).  A simple
+computer program that implements Pipletti's classification theorem
+for torsion-free Aramaic groups with simplectic socles can then
+finish the remaining cases.}
+
+\bigskip
+\beginsection 1. Introduction.
+
+This is the start of the introduction.
+\bye
+\end{externalDocument}
+
+
+
+\subsection{\LaTeX\ example}
+
+\begin{externalDocument}[
+  grfOptions={width=0.5\linewidth},
+%  pages={1,3},
+  frame,
+  verbose=false,
+  compiler=lualatex,
+  showFilename,
+%  crop,
+  force,
+  code,
+  docType=latex,
+  ext=tex,]{voss}
+\documentclass{report}
+%StartVisiblePreamble
+\usepackage{fontenc}\usepackage{libertinus}
+\usepackage{pst-all}
+%StopVisiblePreamble
+\begin{document}
+\psset{unit=0.8cm}
+\begin{pspicture}(-9,-15)(9,2)
+\psaxes(0,0)(-9,-15)(9,2)
+\psplot[algebraic,plotstyle=curve,curvature=1 1 0, 
+  linewidth=1pt,linecolor=red]{-8}{8}{
+  1 - 3876218985722260225*x^2/10892114744073986176 
+    + 14975974793271450625*x^4/174273835905183778816 
+    - 317095420958296875*x^6/26811359370028273664 
+    + 194412970920703125*x^8/214490874960226189312 
+    - 2090988251953125*x^10/53622718740056547328 
+    + 99480224609375*x^12/107245437480113094656 
+    - 7879638671875*x^14/697095343620735115264 
+    + 152587890625*x^16/2788381374482940461056}
+\end{pspicture}
+\end{document}
+\end{externalDocument}
+
+
+\subsection{\ConTeXt\ example}
+
+
+\begin{externalDocument}[
+  grfOptions={width=0.3\linewidth},
+  pages={1,2,3},
+  frame,
+  verbose=false,
+  compiler=context,
+  showFilename,
+  runs=2,
+  force,
+  code,
+  docType=context,
+  ext=tex,]{voss}
+%StartVisiblePreamble
+\definehead
+  [myhead]
+  [section]
+\setuphead
+  [myhead]
+  [numberstyle=bold,
+   textstyle=bold,
+   before=\hairline\blank,
+   after=\nowhitespace\hairline]
+%StopVisiblePreamble
+\starttext
+\startstandardmakeup
+\midaligned{From Hasselt to America}
+\midaligned{by}
+\midaligned{J. Jonker and C. van Marle}
+\stopstandardmakeup
+\placecombinedlist[content]
+\chapter{Introduction}
+\input knuth \input knuth 
+\chapter[rensselaer]{The Rensselaer family}
+\section{The first born}
+\input knuth 
+\section{The early years}
+... in those days Hasselt was ...
+\section{Living and workin in America}
+\input knuth
+\chapter[lansing]{The Lansing family}
+... the Lansing family was also ...
+\chapter[cuyler]{The Cuyler family}
+... much later Tydeman Cuyler ...
+\myhead[headlines]{And the end}
+foo
+\stoptext
+\end{externalDocument}
+
+
+\section{Other options}
+
+\begin{description}
+\item[\texttt{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[\texttt{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[\texttt{copyToExampleDir}] name of a directory for the examples, must first be created by the user himself
+\item[\texttt{ExamplesDir}] move all examples into a directory
+\item[\texttt{eps}] create an eps from the pdf (historical)
+\end{description}
+
+
+
+
+
+\end{document}
+
+


Property changes on: trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,22 @@
+%% This is file `hvextern-ctx.cfg',
+%%
+%% Copyright (C) 2016-22   Herbert Voß  hvoss at tug.org
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\def\hvFileversion{0.01}
+\ProvidesFile{hvextern-ctx}[2022/04/21 v\hvFileversion: running context (HV)]
+
+\extern at ExampleType{context}
+  {\string\starttext}
+  {\string\stoptext}
+  {\perCent StartVisiblePreamble}
+  {\perCent StopVisiblePreamble}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,31 @@
+%% This is file `hvextern-mp.cfg',
+%%
+%% Copyright (C) 2016-22   Herbert Voß  hvoss at tug.org
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\def\hvFileversion{0.01}
+\ProvidesFile{hvextern-latex}[2022/04/21 v\hvFileversion: running latex (HV)]
+
+\extern at ExampleType{latex}%                      
+  {\string\begin\string{document\string}}%       
+  {\string\end\string{document\string}}%         
+  {\perCent StartVisiblePreamble}%               
+  {\perCent StopVisiblePreamble}%                
+
+% only for the sequence latex->dvips->ps2pdf
+\def\hv at extern@runLATEX#1#2#3#4{% path compiler file extension
+  \ifhv at extern@verbose \typeout{>>>> running #1#2 #3#4}\fi
+  \ShellEscape{#1#2\space #3#4}%
+  \ifhv at extern@verbose \typeout{>>>> running #1dvips #3}\fi
+  \ShellEscape{#1dvips\space #3.dvi}%
+  \ifhv at extern@verbose \typeout{>>>> running ps2pdf #3.ps}\fi
+  \ShellEscape{#1ps2pdf\space -dAutoRotatePages=/None\space -dALLOWPSTRANSPARENCY\space  #3.ps}%
+}
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,22 @@
+%% This is file `hvextern-lua.cfg',
+%%
+%% Copyright (C) 2016-22   Herbert Voß  hvoss at tug.org
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\def\hvFileversion{0.01}
+\ProvidesFile{hvextern-lua}[2022/04/23 v\hvFileversion: running Lua (HV)]
+
+\extern at ExampleType{lua}
+  {--StartVisibleMain}
+  {--StopVisibleMain}
+  {--StartVisiblePreamble}
+  {--StopVisiblePreamble}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,32 @@
+%% This is file `hvextern-mp.cfg',
+%%
+%% Copyright (C) 2016-22   Herbert Voß  hvoss at tug.org
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\def\hvFileversion{0.01}
+\ProvidesFile{hvextern-mp}[2022/04/21 v\hvFileversion: running MetaPost (HV)]
+
+\extern at ExampleType{mp}
+  {beginfig(1)}
+  {endfig;}
+  {\perCent StartVisiblePreamble}
+  {\perCent StopVisiblePreamble}
+
+\def\hv at extern@runMP#1#2#3#4{% path compiler file extension
+  \ifhv at extern@verbose \typeout{>>>> running #1#2 #3#4}\fi
+  \ShellEscape{#1#2\space -tex=tex\space #3#4}%
+  \ifhv at extern@verbose \typeout{>>>> running #1tex #3}\fi
+  \ShellEscape{#1tex\space "\string\input\space epsf\string\relax\string\nopagenumbers\string\epsfbox{#3.1}\string\bye"}%
+  \ifhv at extern@verbose \typeout{>>>> running #1dvips #3}\fi
+  \ShellEscape{#1dvips\space -j\space -E\space -o\space #3.eps\space epsf.dvi}%
+  \ifhv at extern@verbose \typeout{>>>> running #1epstopdf #3}\fi
+  \ShellEscape{#1epstopdf\space #3.eps}%
+}
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,22 @@
+%% This is file `hvextern-pl.cfg',
+%%
+%% Copyright (C) 2016-22   Herbert Voß  hvoss at tug.org
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\def\hvFileversion{0.01}
+\ProvidesFile{hvextern-pl}[2022/04/22 v\hvFileversion: running Perl (HV)]
+
+\extern at ExampleType{pl}
+  {\NumChar StartVisibleMain}
+  {\NumChar StopVisibleMain}
+  {\NumChar StartVisiblePreamble}
+  {\NumChar StopVisiblePreamble}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,27 @@
+%% This is file `hvextern-py.cfg',
+%%
+%% Copyright (C) 2016-22   Herbert Voß  hvoss at tug.org
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\def\hvFileversion{0.01}
+\ProvidesFile{hvextern-py}[2022/04/22 v\hvFileversion: running Python (HV)]
+
+\extern at ExampleType{py}
+  {\NumChar StartVisibleMain}
+  {\NumChar StopVisibleMain}
+  {\NumChar StartVisiblePreamble}
+  {\NumChar StopVisiblePreamble}
+
+%\def\hv at extern@runPYTHON#1#2#3#4{% path compiler file extension
+%  \ifhv at extern@verbose \typeout{>>>> running #1#2 #3#4}\fi
+%  \ShellEscape{#1python2\space #3#4}%   for special version
+%}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,30 @@
+%% This is file `hvextern-mp.cfg',
+%%
+%% Copyright (C) 2016-22   Herbert Voß  hvoss at tug.org
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\def\hvFileversion{0.01}
+\ProvidesFile{hvextern-latex}[2022/04/21 v\hvFileversion: running latex (HV)]
+
+\extern at ExampleType{tex}
+  {\perCent StartBody}
+  {\string\bye}
+  {\perCent StartVisiblePreamble}
+  {\perCent StopVisiblePreamble}
+
+\def\hv at extern@runTEX#1#2#3#4{% path compiler file extension
+  \ifhv at extern@verbose \typeout{>>>> running #1#2 #3#4}\fi
+  \ShellEscape{#1tex\space #3#4}%
+  \ifhv at extern@verbose \typeout{>>>> running #1dvips #3}\fi
+  \ShellEscape{#1dvips\space #3.dvi}%
+  \ifhv at extern@verbose \typeout{>>>> running ps2pdf #3.ps}\fi
+  \ShellEscape{#1ps2pdf\space -dAutoRotatePages=/None\space -dALLOWPSTRANSPARENCY\space #3.ps}%
+}
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	2022-04-25 20:27:47 UTC (rev 63140)
@@ -0,0 +1,332 @@
+%% This is file `hvextern.sty',
+%%
+%% Copyright (C) 2016-22
+%% Herbert Voss
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\def\hvexternFileversion{0.19}
+\ProvidesFile{hvextern}[2022/04/23 v\hvexternFileversion: package for running external documents (HV)]
+
+\RequirePackage{shellesc,xkeyval,graphicx,marginnote,fancyvrb,tikz,listings,ifplatform}
+\RequirePackage{tcolorbox}
+\tcbuselibrary{skins,breakable}
+
+\ifwindows
+  \def\hv at move{move }%
+  \def\hv at rm{del }%
+\else
+  \def\hv at move{mv }
+  \def\hv at rm{rm }
+\fi
+
+\newcounter{hv at extern@runs}
+\newcounter{@@@runs} 
+\newsavebox\hv at extern@box
+\newlength\LineWidth
+\AtBeginDocument{\setlength\LineWidth{\dimexpr\linewidth-2\fboxsep-2\fboxrule}}
+\newlength\hv at extern@mpwidth \setlength\hv at extern@mpwidth{\z@}
+
+\define at key{hv}{progpath}{\def\hv at extern@progpath{#1}}
+\define at key{hv}{runsequence}[]{\def\hv at extern@runsequence{#1}}
+\define at key{hv}{runs}[1]{\setcounter{hv at extern@runs}{#1}}
+\define at key{hv}{grfOptions}[]{\def\hv at extern@grfOptions{#1}}
+\define at key{hv}{lstOptions}[]{\def\hv at extern@lstOptions{#1}}
+\define at key{hv}{BGpreamble}[black!12]{\def\hv at extern@BGpreamble{#1}}
+\define at key{hv}{BGbody}[black!8]{\def\hv at extern@BGbody{#1}}
+\define at key{hv}{BOpreamble}[black!12]{\def\hv at extern@BOpreamble{#1}}
+\define at key{hv}{BObody}[black!8]{\def\hv at extern@BObody{#1}}
+\define at key{hv}{docType}[latex]{\def\hv at extern@docType{#1}}
+\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}{cropmargin}[2]{\def\hv at extern@cropmargin{#1 }}
+\define at key{hv}{mpwidth}[0pt]{\setlength\hv at extern@mpwidth{#1}}
+\define at key{hv}{ext}[tex]{\def\hv at extern@ext{.#1}}
+\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@]{code}[true]{}
+\define at boolkey{hv}[hv at extern@]{force}[true]{}
+\define at boolkey{hv}[hv at extern@]{crop}[true]{}
+\define at boolkey{hv}[hv at extern@]{biber}[true]{}
+\define at boolkey{hv}[hv at extern@]{xindex}[true]{}
+\define at key{hv}{xindexOptions}[]{\def\hv at extern@xindexOptions{#1}}
+\define at boolkey{hv}[hv at extern@]{includegraphic}[true]{}
+\define at boolkey{hv}[hv at extern@]{inline}[true]{\hv at extern@codefalse}
+\define at boolkey{hv}[hv at extern@]{frame}[true]{}
+\define at boolkey{hv}[hv at extern@]{float}[true]{}
+%\define at boolkey{hv}[hv at extern@]{cleanup}[true]{}
+\define at key{hv}{cleanup}[{aux,log}]{\def\hv at extern@cleanup{#1}}% 
+\define at boolkey{hv}[hv at extern@]{moveToExampleDir}[true]{}
+\define at key{hv}{align}[\centering]{\def\hv at extern@align{#1}}
+\define at key{hv}{ExampleDir}[Examples]{%
+  \ifhv at extern@moveToExampleDir
+    \def\hv at extern@ExamplesDir{#1/}%
+  \else
+    \def\hv at extern@ExamplesDir{}%
+  \fi
+}
+\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,xetex,pdflatex,lualatex,xelatex,context}[pdflatex]{% 
+%  \hv at typeout{>>>> Compiler type \nr}%
+  \def\hv at extern@compiler{\val}%
+  \edef\hv at extern@compilerNo{\nr}%
+}{\PackageWarning{hvextern}{erroneous input (#1) for compiler ignored. Using pdflatex.}%
+  \def\hv at extern@compiler{pdflatex}%
+  \def\hv at extern@compilerNo{6}%
+ }
+
+\def\ResetKeys{%
+ \setkeys{hv}{
+  showFilename=false,%  Dateinamen im Rand angeben
+  ext=tex,%             file extension
+  code=false,%          show Code
+  crop=false,%		erzeugte PDF "croppen"
+  compiler=pdflatex,%	zu verwendener Compiler
+  grfOptions={},%	Optionen der einzubindenden Grafik
+  lstOptions={},%	Optionen für das Listing
+  BGpreamble=black!12,% Backgroundcolor for preamble
+  BGbody=black!8,%      Backgroundcolor for body
+  BOpreamble=black!12,% Bodercolor for preamble
+  BObody=black!8,%      Bodercolor for body
+  includegraphic=true,% Grafik einbinden oder User überlassen
+  inline=false,%        Grafik nicht in derselben Zeile
+  runs=1,%		Anzahl Compiler-Durchläufe
+  runsequence={},%	Im Moment nicht aktiv
+  biber=false,%		Biber laufen lassen?
+  xindex=false,%	xindex laufen lassen?
+  xindexOptions={},%     options for xindex
+  force=false,%		Compiler, auch wenn PDF existiert?
+  frame=false,%		keinen Rahmen um Abbildung
+  float=false,%		nicht als Gleitumgebung
+  caption=,%	        keine Caption
+  label=,%		kein Label
+  pages=1,%		welche Seiten auszugeben sind
+  docType=latex,%	LaTeX example Code
+  cleanup={},% 	        Hilfsdateien nicht löschen
+  moveToExampleDir=false,%  Verschieben nach ExamplesDir
+  ExampleDir=Examples,% Unterverzeichnis für Beispiele
+  align=\centering,%    Ausgabe zentrieren
+  mpwidth=0pt,%         no minipage
+  usefancyvrb=false,%   use VerbatimInput instead of listings
+  progpath={},
+  cropmargin=2,%        2pb margin
+  eps=false,%           create an eps output?          
+  }
+}
+\ResetKeys
+
+{\catcode`\%=12
+ \catcode`\#=12 
+ \gdef\perCent{%}
+ \gdef\DoubleperCent{%%}
+ \gdef\NumChar{#}
+ \gdef\DoubleNumChar{##}
+}
+
+\def\run at hv@extern at cleanup#1{\expandafter\run at hv@extern at cleanup@i#1,\@nil}
+\def\run at hv@extern at cleanup@i#1,#2\@nil{%
+  \def\hv at next{}%
+  \ifx\relax#1\relax
+  \else
+    \hv at typeout{>>>> Delete file \hv at extern@ExamplesDir\hvExternDateiname.#1}%
+    \ShellEscape{\hv at rm \hv at extern@ExamplesDir\hvExternDateiname.#1}%
+    \ifx\relax#2\relax\else      
+      \def\hv at next{\run at hv@extern at cleanup@i#2,\@nil}%
+    \fi
+  \fi
+  \hv at next
+}
+
+
+\lstset{belowskip=0pt,aboveskip=0pt}% global
+\tcbset{breakable,left=2pt,right=2pt,top=2pt,bottom=2pt,boxsep=0pt}
+
+\newcommand\PreambleVerbatim[2][]{\begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}}
+
+\newcommand\BodyVerbatim[2][]{\begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}}
+
+\newcommand\PreambleListing[2][]{\begin{tcolorbox}\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}}
+
+\newcommand\BodyListing[2][]{\begin{tcolorbox}\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}}
+
+\newcounter{hv at example@counter}
+
+\newcommand\extern at ExampleType[5]{%
+  \@namedef{#1 at initTextFancy}{\edef\FancyVerbStartString{#2}\edef\FancyVerbStopString{#3}}% text
+  \@namedef{#1 at initPreambleFancy}{\edef\FancyVerbStartString{#4}\edef\FancyVerbStopString{#5}}% code
+  \@namedef{#1 at initText}{linerange={#2}-{#3},includerangemarker=false}% text
+  \@namedef{#1 at initPreamble}{linerange={#4}-{#5},includerangemarker=false}% code
+}%                                      ^^to prevent problems with lua comments
+
+\input{hvextern-mp.cfg}
+\input{hvextern-tex.cfg}
+\input{hvextern-latex.cfg}
+\input{hvextern-context.cfg}
+\input{hvextern-py.cfg}
+\input{hvextern-pl.cfg}
+\input{hvextern-lua.cfg}
+
+%%
+%% [#1]: Optionen  #2: Dateiname
+%%
+\newenvironment{ErstelleGrafik}[2][]{%
+   \xdef\hvExternDateiname{#2-\arabic{hv at example@counter}}%
+   \setkeys{hv}{#1}%                   \begin
+   \expandafter\IfFileExists\expandafter{\hv at extern@ExamplesDir\hvExternDateiname.pdf}{}{%  
+     \expandafter\IfFileExists\expandafter{\hv at extern@ExamplesDir\hvExternDateiname.png}{}{%
+       \expandafter\IfFileExists\expandafter{\hv at extern@ExamplesDir\hvExternDateiname.txt}{}{%
+         \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}
+  }
+  {\endfilecontents%         \end
+   \hv at typeout{>>> ... done}%
+   \global\stepcounter{hv at example@counter}%
+   \endgroup
+   \ifhv at extern@force
+     \hv at typeout{>>> force=true: running \hv at extern@progpath\hv at extern@compiler~ \hvExternDateiname\hv at extern@ext ...}%
+     \setcounter{@@@runs}{\value{hv at extern@runs}}%
+     \loop\ifnum\the@@@runs > 0\relax
+       \ifcase\hv at extern@compilerNo  \relax   % we have metapost
+         \hv at typeout{>>>> running mpost \hvExternDateiname\hv at extern@ext}%
+         \hv at extern@runMP{\hv at extern@progpath}{\hv at extern@compiler}{\hvExternDateiname}{\hv at extern@ext}%       
+       \or %1
+         \hv at typeout{>>>> running tex \hvExternDateiname\hv at extern@ext}%
+         \hv at extern@runTEX{\hv at extern@progpath}{\hv at extern@compiler}{\hvExternDateiname}{\hv at extern@ext}%       
+       \or %2
+         \hv at typeout{>>>> running \hv at extern@compiler~ \hvExternDateiname\hv at extern@ext}%
+         \hv at extern@runLATEX{\hv at extern@progpath}{\hv at extern@compiler}{\hvExternDateiname}{\hv at extern@ext}%       
+       \else
+         \hv at typeout{>>>> running \hv at extern@compiler~ \hvExternDateiname\hv at extern@ext}%
+         \ShellEscape{\hv at extern@progpath\hv at extern@compiler\space\hvExternDateiname\hv at extern@ext}%
+       \fi
+       \addtocounter{@@@runs}{-1}%
+     \repeat
+     \hv at typeout{>>> ... done}%
+     \ifhv at extern@biber
+       \ShellEscape{biber  \hvExternDateiname}%  NAch biber nochmal latex
+       \ShellEscape{\hv at extern@progpath\hv at extern@compiler\space\hvExternDateiname}%
+     \fi
+     \ifhv at extern@xindex 
+       \ShellEscape{xindex \hv at extern@xindexOptions\space \hvExternDateiname.idx}%  NAch xindex nochmal latex
+       \ShellEscape{\hv at extern@progpath\hv at extern@compiler\space\hvExternDateiname}%
+     \fi
+     \ifhv at extern@crop
+       \ShellEscape{pdfcrop --margins \hv at extern@cropmargin \hvExternDateiname}%
+       \ShellEscape{\hv at move \hvExternDateiname-crop.pdf \hvExternDateiname.pdf}%
+     \fi
+     \ifhv at extern@eps
+       \ShellEscape{pdftops -eps -f 1 -l 1 \hvExternDateiname.pdf}%
+     \fi
+   \fi
+   \ifhv at extern@code%--------------        Code Part
+     \par\noindent
+     \begingroup
+      \ifdim\hv at extern@mpwidth>\z@ \minipage[t]{\hv at extern@mpwidth}\vspace{0pt}\fi
+      \ifhv at extern@usefancyvrb
+         \@nameuse{\hv at extern@docType @initPreambleFancy}%
+         \edef\@@@temp{\@nameuse{\hv at extern@docType @initPreamble}}%
+         % 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@
+           \expandafter\fvset\expandafter{\hv at extern@lstOptions}%
+           \tcbset{colback=\hv at extern@BGpreamble,colframe=\hv at extern@BOpreamble}%
+           \PreambleVerbatim{\hvExternDateiname\hv at extern@ext}%
+         \fi
+      \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@
+          \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}%
+        \fi
+      \fi
+      \ifhv at extern@showFilename
+         \marginnote{\rotatebox{90}{\hvExternDateiname\hv at extern@ext}}%[-15mm]%
+      \fi
+%     
+       \ifhv at extern@usefancyvrb
+         \@nameuse{\hv at extern@docType @initTextFancy}%
+         \expandafter\fvset\expandafter{\hv at extern@lstOptions}%
+         \tcbset{colback=\hv at extern@BGbody,colframe=\hv at extern@BObody}%
+         \expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hvExternDateiname\hv at extern@ext}%
+       \else
+         \expandafter\lstset\expandafter{\hv at extern@lstOptions}%
+         \edef\@@@temp{\@nameuse{\hv at extern@docType @initText}}%
+         \tcbset{colback=\hv at extern@BGbody,colframe=\hv at extern@BObody}%
+         \BodyListing[\@@@temp]{\hvExternDateiname\hv at extern@ext}%
+       \fi
+     \ifdim\hv at extern@mpwidth > \z@\relax \endminipage\fi
+     \endgroup
+   \fi
+   \ifhv at extern@code\else
+      \ifhv at extern@showFilename
+        \marginnote{\rotatebox{90}{\hvExternDateiname}}%
+      \fi
+   \fi
+   \ifhv at extern@moveToExampleDir
+%     \ShellEscape{mkdir\space\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}%
+     \else
+       \ifhv at extern@float
+         \begin{figure}[!htb]
+       \else
+         \ifdim\hv at extern@mpwidth>\z@ 
+           \hfill\minipage[t]{\dimexpr\linewidth-\hv at extern@mpwidth-1em\relax}\vspace{0pt}%
+         \else
+           \par\noindent\begingroup
+         \fi
+       \fi
+       \hv at extern@align
+       \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}%
+       \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}%
+       \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
+       \ifhv at extern@float
+         \end{figure}%
+       \else
+         \ifdim\hv at extern@mpwidth>\z@  \endminipage\else\par\endgroup\fi
+       \fi
+     \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\VerbatimInput{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+       \endminipage
+     \else
+       \noindent\VerbatimInput{\hv at extern@ExamplesDir\hvExternDateiname.txt}
+     \fi
+   \fi
+   \ifhv at extern@force\run at hv@extern at cleanup{\hv at extern@cleanup}\fi%   cleanup
+}
+\stepcounter{hv at example@counter}%
+%
+\let\externalDocument\ErstelleGrafik
+\let\endexternalDocument\endErstelleGrafik
+%%
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-04-25 20:23:46 UTC (rev 63139)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-04-25 20:27:47 UTC (rev 63140)
@@ -398,7 +398,7 @@
     hmtrump hobby hobete hobsub hologo hook-pre-commit-pkg hopatch horoscop
     hpsdiss href-ul hrefhide hrlatex
     hu-berlin-bundle huawei hulipsum hustthesis
-    hvarabic hvfloat hvindex hvlogos hvpygmentex hvqrurl
+    hvarabic hvextern hvfloat hvindex hvlogos hvpygmentex hvqrurl
     hycolor hypdestopt hypdoc hypdvips
     hyper hyperbar hypernat hyperref hyperxmp
     hyph-utf8 hyphen-base

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2022-04-25 20:23:46 UTC (rev 63139)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2022-04-25 20:27:47 UTC (rev 63140)
@@ -641,6 +641,7 @@
  'holtxdoc',    "die 'skipping, use oberdiek'",
  'hsindex',	"die 'skipping, haskell compilation'",
  'hvarabic',	"&MAKEflatten",
+ 'hvextern',	"&MAKEflatten",
  'hvfloat',     "&MAKEflatten",
  'hvindex',     "&MAKEflatten",
  'hvlogos',	"&MAKEflatten",
@@ -2047,6 +2048,7 @@
  'mhchem',	'hpstatement.inc|' . $standardtex,
  'hrefhide',    '\.sty|[^c]\.cfg',      # omit ltxdoc.cfg, would be system-wide
  'huawei',	'.*cover-picture\.pdf|' . $standardtex,
+ 'hvextern',	'\.cfg|' . $standardtex,
  'hyper',       '^[^d].*\.sty|\.hyp',   # not defpattern.sty
  'hyphenex',    'ushyphex\.tex',
  'hyplain',     '(hyrules|hy.*plain|hylang)\..*',

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2022-04-25 20:23:46 UTC (rev 63139)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2022-04-25 20:27:47 UTC (rev 63140)
@@ -637,6 +637,7 @@
 depend href-ul
 depend hrefhide
 depend huawei
+depend hvextern
 depend hvindex
 depend hvlogos
 depend hvpygmentex

Added: trunk/Master/tlpkg/tlpsrc/hvextern.tlpsrc
===================================================================


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