texlive[63159] Master/texmf-dist: hvextern (27apr22)

commits+karl at tug.org commits+karl at tug.org
Wed Apr 27 21:38:46 CEST 2022


Revision: 63159
          http://tug.org/svn/texlive?view=revision&revision=63159
Author:   karl
Date:     2022-04-27 21:38:45 +0200 (Wed, 27 Apr 2022)
Log Message:
-----------
hvextern (27apr22)

Modified Paths:
--------------
    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/hvextern.sty

Removed Paths:
-------------
    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

Modified: trunk/Master/texmf-dist/doc/latex/hvextern/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/Changes	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/Changes	2022-04-27 19:38:45 UTC (rev 63159)
@@ -1,4 +1,7 @@
 hvextern.sty ----------------
 
+v 0.20 2022-04-27  - use L3 for the comma separated lists
+                     cleanup and runsequence
+                   - move the config files into the main file
 v 0.19 2022-04-23  first CTAN version
 

Modified: trunk/Master/texmf-dist/doc/latex/hvextern/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/README	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/README	2022-04-27 19:38:45 UTC (rev 63159)
@@ -1,6 +1,6 @@
-This package allows to write code in tex, latex, Perl, Lua, PYthon,
+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
+output as pdf/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
 

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-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex	2022-04-27 19:38:45 UTC (rev 63159)
@@ -11,6 +11,7 @@
 \usepackage{listings}
 \lstset{basicstyle=\ttfamily\small,language=[LaTeX]TeX,breaklines}
 \usepackage{xcolor}
+\usepackage{hyperref}
 \begin{document}
 \title{Writing, running and including the output of external documents 
 from within a main \LaTeX\ document~--v. \hvexternFileversion}
@@ -58,6 +59,15 @@
 a different preamble or a different engine or a complete different system, but integrating the output
 automatically in the main document..
 
+\bigskip
+\noindent
+\fbox{\begin{minipage}{\dimexpr\linewidth-2\fboxsep-2\fboxrule\relax}
+\emph{All} examples in this document are created on-the-fly while running this \LaTeX\ document
+with \texttt{lualatex} with the  \texttt{-\kern2pt-shell-escape} option.
+\end{minipage}}
+
+
+
 \section{First examples}
 \subsection{Without showing the code}
 
@@ -137,7 +147,7 @@
 The code which is declared as header and main can be marked by:
 
 \begin{Verbatim}
-\extern at ExampleType{py}
+\hv at extern@exampleType{py}
   {\NumChar StartVisibleMain}
   {\NumChar StopVisibleMain}
   {\NumChar StartVisiblePreamble}
@@ -296,11 +306,11 @@
 
 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}:
+ \verb|\begin{document}| and \verb|\end{document}| as body. The marker must be defined with an own
+macro, e.g.:
  
 \begin{verbatim}
-\extern at ExampleType{py}
+\hv at extern@exampleType{py}
   {\NumChar StartVisibleMain}
   {\NumChar StopVisibleMain}
   {\NumChar StartVisiblePreamble}
@@ -314,7 +324,7 @@
 context, lua, pl, tex, latex, mp, and py. For Lua it is
 
 \begin{verbatim}
-\extern at ExampleType{lua}
+\hv at extern@exampleType{lua}
   {--StartVisibleMain}
   {--StopVisibleMain}
   {--StartVisiblePreamble}
@@ -336,7 +346,7 @@
 
 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.
+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}}
@@ -345,6 +355,54 @@
 \define at key{hv}{runs}[1]{\setcounter{hv at extern@runs}{#1}}
 \end{verbatim}
 
+Instead of the optional arguments
+ \texttt{compiler}, \texttt{biber}, and \texttt{xindex} one can define an individual
+ command sequence by using the optional argument
+ \texttt{runsequence}. It must be comma separated list:
+ 
+\begin{verbatim}
+runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex}
+\end{verbatim}
+
+\begin{externalDocument}[
+  grfOptions={width=0.30\linewidth},
+  pages={1,3,5},
+  frame,
+  runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex},
+  showFilename,
+  verbose,
+  force,
+  cleanup={log,aux,toc,bbl,blg},
+  code,docType=latex,
+  lstOptions={columns=fixed}]{voss}
+\documentclass[paper=a5,parskip=half-,DIV=12,fontsize=12pt]{scrbook}
+%StartVisiblePreamble
+\usepackage[ngerman]{babel}
+\usepackage{libertinus,hvindex}
+\usepackage{makeidx}\makeindex
+\usepackage{biblatex}\addbibresource{biblatex-examples.bib}
+%StopVisiblePreamble
+\usepackage{blindtext}
+\begin{document}
+Sort with xindex \verb|-l DE --config AU|
+\blindtext
+\Index{Österreich} \Index{Öresund} 
+\Index{Ostern} \Index{Ober} \Index{Oberin} 
+\Index{Österreich} \Index{Öresund} 
+\Index{Ödem} \Index{Oligarch} \Index{Oder} 
+\Index{Goldmann}
+\printindex
+\nocite{*}\printbibliography
+\blindtext
+\blinddocument
+
+\end{document}
+\end{externalDocument}
+
+
+
+
+
 \subsection{Grafik options}
 \begin{verbatim}
 \define at key{hv}{grfOptions}[]{\def\hv at extern@grfOptions{#1}}
@@ -469,12 +527,12 @@
 \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}:
+\MP, \plainTeX, \LaTeX, \ConTeXt, and Python. Every type has its own keywords for the 
+linerange which should be printed for the preamble and
+the body. For example the \texttt{latex} config is:
 
 \begin{verbatim}
-\extern at ExampleType{latex}%                   for _all_LaTeX engines   
+\hv at extern@exampleType{latex}%                   for _all_LaTeX engines   
   {\string\begin\string{document\string}}%       
   {\string\end\string{document\string}}%         
   {\perCent StartVisiblePreamble}%               
@@ -1000,6 +1058,7 @@
 \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 key{hv}{runsequence}[]{\def\hv at extern@runsequence{#1}}
 \end{verbatim}
 
 The \texttt{biber} run needs no additional options, but for \texttt{xindex} it maybe useful.
@@ -1007,13 +1066,9 @@
 
 \begin{verbatim}
 \begin{externalDocument}[
-  compiler=lualatex, runs=2,
-  pages=2,
-  crop,
-  xindex,
-  xindexOptions={-l DE --config AU},
-  mpwidth=0.6\linewidth,
-  usefancyvrb=false,
+  compiler=lualatex, runs=2, pages=2,crop,
+  xindex, xindexOptions={-l DE --config AU},
+  mpwidth=0.6\linewidth, usefancyvrb=false,
   docType=latex,
   ...
 ]{voss}
@@ -1073,11 +1128,53 @@
 \end{externalDocument}
 
 
+Instad of using the options \texttt{compiler}, \texttt{biber}, and \texttt{xindex} 
+one can also use only the optional argument \texttt{runsequence} to define an individuell
+sequence of commands, e.g.:
+\begin{verbatim}
+runsequence={lualatex,biber,{xindex -l de -c AU},lualatex,lualatex}
+\end{verbatim}
 
+\begin{externalDocument}[
+  grfOptions={width=0.30\linewidth},
+  pages={1,3,5},
+  frame,
+  runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex},
+  showFilename,
+  verbose,
+  force,
+  cleanup={log,aux,toc,bbl,blg},
+  code,docType=latex,
+  lstOptions={columns=fixed}]{voss}
+\documentclass[paper=a5,parskip=half-,DIV=12,fontsize=12pt]{scrbook}
+%StartVisiblePreamble
+\usepackage[ngerman]{babel}
+\usepackage{libertinus,hvindex}
+\usepackage{makeidx}\makeindex
+\usepackage{biblatex}\addbibresource{biblatex-examples.bib}
+%StopVisiblePreamble
+\usepackage{blindtext}
+\begin{document}
+Sort with xindex \verb|-l DE --config AU|
+\blindtext
+\Index{Österreich} \Index{Öresund} 
+\Index{Ostern} \Index{Ober} \Index{Oberin} 
+\Index{Österreich} \Index{Öresund} 
+\Index{Ödem} \Index{Oligarch} \Index{Oder} 
+\Index{Goldmann}
+\printindex
+\nocite{*}\printbibliography
+\blindtext
+\blinddocument
 
+\end{document}
+\end{externalDocument}
 
 
 
+
+
+
 \subsection{Using \texttt{listings}}
 The default is using \verb|\lstinputlisting| for the printed code sequences.
 
@@ -1301,12 +1398,13 @@
   verbose=false,
   compiler=lualatex,
   showFilename,
-%  crop,
+  crop,
   force,
   code,
   docType=latex,
   ext=tex,]{voss}
 \documentclass{report}
+\pagestyle{empty}
 %StartVisiblePreamble
 \usepackage{fontenc}\usepackage{libertinus}
 \usepackage{pst-all}

Deleted: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg	2022-04-27 19:38:45 UTC (rev 63159)
@@ -1,22 +0,0 @@
-%% 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

Deleted: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg	2022-04-27 19:38:45 UTC (rev 63159)
@@ -1,31 +0,0 @@
-%% 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

Deleted: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg	2022-04-27 19:38:45 UTC (rev 63159)
@@ -1,22 +0,0 @@
-%% 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

Deleted: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg	2022-04-27 19:38:45 UTC (rev 63159)
@@ -1,32 +0,0 @@
-%% 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

Deleted: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg	2022-04-27 19:38:45 UTC (rev 63159)
@@ -1,22 +0,0 @@
-%% 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

Deleted: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg	2022-04-27 19:38:45 UTC (rev 63159)
@@ -1,27 +0,0 @@
-%% 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

Deleted: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg	2022-04-27 19:38:45 UTC (rev 63159)
@@ -1,30 +0,0 @@
-%% 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

Modified: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	2022-04-27 14:43:04 UTC (rev 63158)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty	2022-04-27 19:38:45 UTC (rev 63159)
@@ -11,11 +11,11 @@
 %% 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)]
+\def\hvexternFileversion{0.20}
+\ProvidesFile{hvextern}[2022/04/27 v\hvexternFileversion: package for running external documents (HV)]
 
 \RequirePackage{shellesc,xkeyval,graphicx,marginnote,fancyvrb,tikz,listings,ifplatform}
-\RequirePackage{tcolorbox}
+\RequirePackage{tcolorbox,xparse}
 \tcbuselibrary{skins,breakable}
 
 \ifwindows
@@ -29,8 +29,8 @@
 \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 LineWidth
+\AtBeginDocument{\setlength\hv at 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}}
@@ -49,6 +49,7 @@
 \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@]{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@]{code}[true]{}
@@ -93,6 +94,7 @@
   code=false,%          show Code
   crop=false,%		erzeugte PDF "croppen"
   compiler=pdflatex,%	zu verwendener Compiler
+  redirect=false,%      write output into a file *.txt
   grfOptions={},%	Optionen der einzubindenden Grafik
   lstOptions={},%	Optionen für das Listing
   BGpreamble=black!12,% Backgroundcolor for preamble
@@ -134,21 +136,20 @@
  \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
-}
+\ExplSyntaxOn
+\NewDocumentCommand\run at hv@extern at cleanup{ m }
+ {
+  \clist_map_inline:nn {#1}{\ShellEscape{\hv at rm \hv at extern@ExamplesDir\hvExternDateiname.##1}} 
+ }
+\NewDocumentCommand\run at hv@extern at sequenceList{ m }
+ {
+  \clist_map_inline:nn {#1}{%
+    \ShellEscape{\hv at extern@progpath##1\space\hvExternDateiname}
+    %\hv at typeout{>>>> sequencerun: ##1}
+  } 
+ }
+\ExplSyntaxOff
 
-
 \lstset{belowskip=0pt,aboveskip=0pt}% global
 \tcbset{breakable,left=2pt,right=2pt,top=2pt,bottom=2pt,boxsep=0pt}
 
@@ -162,7 +163,7 @@
 
 \newcounter{hv at example@counter}
 
-\newcommand\extern at ExampleType[5]{%
+\newcommand\hv at extern@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
@@ -169,18 +170,102 @@
   \@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}
+%%------------------   the config part --------------------
+%\input{hvextern-mp.cfg}
+%----  MP
+\hv at extern@ExampleType{mp}
+  {beginfig(1)}
+  {endfig;}
+  {\perCent StartVisiblePreamble}
+  {\perCent StopVisiblePreamble}
 
+\def\hv at extern@runMP#1#2#3#4{% path compiler file extension
+  \hv at typeout{>>>> running #1#2 #3#4}%
+  \ShellEscape{#1#2\space -tex=tex\space #3#4}%
+  \hv at typeout{>>>> running #1tex #3}%
+  \ShellEscape{#1tex\space "\string\input\space epsf\string\relax\string\nopagenumbers\string\epsfbox{#3.1}\string\bye"}%
+  \hv at typeout{>>>> running #1dvips #3}%
+  \ShellEscape{#1dvips\space -j\space -E\space -o\space #3.eps\space epsf.dvi}%
+  \hv at typeout{>>>> running #1epstopdf #3}%
+  \ShellEscape{#1epstopdf\space #3.eps}%
+}
+
+%----  TeX
+%\input{hvextern-tex.cfg}
+\hv at extern@ExampleType{tex}
+  {\perCent StartBody}
+  {\string\bye}
+  {\perCent StartVisiblePreamble}
+  {\perCent StopVisiblePreamble}
+
+\def\hv at extern@runTEX#1#2#3#4{% path compiler file extension
+  \hv at typeout{>>>> running #1#2 #3#4}%
+  \ShellEscape{#1tex\space #3#4}%
+  \hv at typeout{>>>> running #1dvips #3}%
+  \ShellEscape{#1dvips\space #3.dvi}%
+  \hv at typeout{>>>> running ps2pdf #3.ps}%
+  \ShellEscape{#1ps2pdf\space -dAutoRotatePages=/None\space -dALLOWPSTRANSPARENCY\space #3.ps}%
+}
+
+%----  LaTeX
+%\input{hvextern-latex.cfg}
+\hv at extern@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
+  \hv at typeout{>>>> running #1#2 #3#4}%
+  \ShellEscape{#1#2\space #3#4}%
+  \hv at typeout{>>>> running #1dvips #3}%
+  \ShellEscape{#1dvips\space #3.dvi}%
+  \hv at typeout{>>>> running ps2pdf #3.ps}%
+  \ShellEscape{#1ps2pdf\space -dAutoRotatePages=/None\space -dALLOWPSTRANSPARENCY\space  #3.ps}%
+}
+
+%---- ConTeXt
+%\input{hvextern-context.cfg}
+\hv at extern@ExampleType{context}
+  {\string\starttext}
+  {\string\stoptext}
+  {\perCent StartVisiblePreamble}
+  {\perCent StopVisiblePreamble}
+
+%---- Python
+%\input{hvextern-py.cfg}
+\hv at extern@ExampleType{py}
+  {\NumChar StartVisibleMain}
+  {\NumChar StopVisibleMain}
+  {\NumChar StartVisiblePreamble}
+  {\NumChar StopVisiblePreamble}
+
+
+%----  Perl
+%\input{hvextern-pl.cfg}
+\hv at extern@ExampleType{pl}
+  {\NumChar StartVisibleMain}
+  {\NumChar StopVisibleMain}
+  {\NumChar StartVisiblePreamble}
+  {\NumChar StopVisiblePreamble}
+
+
+%----  Lua
+%\input{hvextern-lua.cfg}
+\hv at extern@ExampleType{lua}
+  {--StartVisibleMain}
+  {--StopVisibleMain}
+  {--StartVisiblePreamble}
+  {--StopVisiblePreamble}
+
+
+%%%---------------------------------  end config part ------------------
+
 %%
 %% [#1]: Optionen  #2: Dateiname
 %%
-\newenvironment{ErstelleGrafik}[2][]{%
+\newenvironment{externalDocument}[2][]{%
    \xdef\hvExternDateiname{#2-\arabic{hv at example@counter}}%
    \setkeys{hv}{#1}%                   \begin
    \expandafter\IfFileExists\expandafter{\hv at extern@ExamplesDir\hvExternDateiname.pdf}{}{%  
@@ -196,33 +281,41 @@
    \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}%
+     \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 ...}%
+       \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}%
+           \ifhv at extern@redirect
+             \ShellEscape{\hv at extern@progpath\hv at extern@compiler\space\hvExternDateiname\hv at extern@ext\space > \hvExternDateiname.txt}%
+           \else
+             \ShellEscape{\hv at extern@progpath\hv at extern@compiler\space\hvExternDateiname\hv at extern@ext}%
+           \fi
+         \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
-       \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@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
+     \else
+       \expandafter\run at hv@extern at sequenceList\expandafter{\hv at extern@runsequence}%
+     \fi  
      \ifhv at extern@crop
        \ShellEscape{pdfcrop --margins \hv at extern@cropmargin \hvExternDateiname}%
        \ShellEscape{\hv at move \hvExternDateiname-crop.pdf \hvExternDateiname.pdf}%
@@ -302,7 +395,8 @@
               \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}%
+           \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
@@ -322,11 +416,9 @@
        \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
+   \ifhv at extern@force\expandafter\run at hv@extern at cleanup\expandafter{\hv at extern@cleanup}\fi%   cleanup
 }
 \stepcounter{hv at example@counter}%
 %
-\let\externalDocument\ErstelleGrafik
-\let\endexternalDocument\endErstelleGrafik
 %%
 \endinput



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