summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hvextern
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-05-06 03:00:50 +0000
committerNorbert Preining <norbert@preining.info>2022-05-06 03:00:50 +0000
commit3e3ecb7f722d0904c12ee0648c343b865dc99187 (patch)
tree8c13ed895e7191ed6c6a583a9730bde9cdd2a92f /macros/latex/contrib/hvextern
parentc8185bb3cd55c24b45c9b19c4ea36b8c7057199d (diff)
CTAN sync 202205060300
Diffstat (limited to 'macros/latex/contrib/hvextern')
-rw-r--r--macros/latex/contrib/hvextern/Changes1
-rw-r--r--macros/latex/contrib/hvextern/doc/hvdoctools.sty95
-rw-r--r--macros/latex/contrib/hvextern/doc/hvextern.pdfbin1185723 -> 1195275 bytes
-rw-r--r--macros/latex/contrib/hvextern/doc/hvextern.tex134
-rw-r--r--macros/latex/contrib/hvextern/latex/hvextern.sty43
5 files changed, 206 insertions, 67 deletions
diff --git a/macros/latex/contrib/hvextern/Changes b/macros/latex/contrib/hvextern/Changes
index 9c754a9277..512bf9c194 100644
--- a/macros/latex/contrib/hvextern/Changes
+++ b/macros/latex/contrib/hvextern/Changes
@@ -1,5 +1,6 @@
hvextern.sty ----------------
+v 0.22 2022-05-05 - added mpvalign, tclbox
v 0.21 2022-04-30 - added java support
v 0.20 2022-04-27 - use L3 for the comma separated lists
cleanup and runsequence
diff --git a/macros/latex/contrib/hvextern/doc/hvdoctools.sty b/macros/latex/contrib/hvextern/doc/hvdoctools.sty
new file mode 100644
index 0000000000..04cdd46724
--- /dev/null
+++ b/macros/latex/contrib/hvextern/doc/hvdoctools.sty
@@ -0,0 +1,95 @@
+%% $Id: hvdoctools.sty 1127 2019-12-29 21:42:29Z herbert $
+%%
+%% This file is distributed under the terms of the LaTeX Project Public
+%% License from CTAN archives in directory macros/latex/base/lppl.txt.
+%% Either version 1.3 or, at your option, any later version.
+%%
+% Copyright 2019 Herbert Voss hvoss@tug.org
+%%
+\ProvidesPackage{hvdoctools}[%
+ 2019/11/27 v.0.01 (Herbert Voss) macros for package documentation (hv)]
+%
+\NeedsTeXFormat{LaTeX2e}
+
+\RequirePackage{makeidx}\makeindex
+
+\def\Lfile#1{\texttt{#1}\index{#1@\texttt{#1} (file)}}
+\def\Lext#1{\texttt{.#1}\index{#1@\texttt{.#1} (file extension)}}
+\def\Ldim#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1} (length)}}
+\def\Lcs#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1}}}
+\def\nxLcs#1{\texttt{\textbackslash#1}}
+\def\Lenv#1{\texttt{#1}\index{#1@\texttt{#1} (environment)}}
+\def\Lpack#1{\texttt{#1}\index{#1@\texttt{#1} (package)}}
+\let\LPack\Lpack
+\def\Lprog#1{\texttt{#1}\index{#1@\texttt{#1} (program)}}
+\def\Lcolor#1{\texttt{#1}\index{#1@\texttt{#1} (color)}}
+\def\Loption#1{\texttt{#1}\index{#1@\texttt{#1} (package option)}}
+\def\Lkeyword#1{\texttt{#1}\index{#1@\texttt{#1} (keyword)}}
+\def\Lkeyval#1{\texttt{#1}\index{#1@\texttt{#1} (value)}}
+\def\Lskip#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1} (skip)}}
+\def\Lkeyset#1{\expandafter\Lkeyset@i#1\@nil}
+\def\Lkeyset@i#1=#2\@nil{\texttt{#1=#2}%
+ \index{#1@\texttt{#1} (keyword)}\index{Keyword!#1@\texttt{#1}}
+ \index{#2@\texttt{#2} (value)}\index{Value!#2@\texttt{#2}}}
+\newsavebox\boxdef
+\newenvironment{BDef}
+ {\begin{lrbox}{\boxdef}
+ \def\arraystretch{1.0}
+ \begin{tabular}{@{}l@{}l@{}l@{}}}
+ {\end{tabular}\end{lrbox}
+ {\BCmd\fbox{\usebox\boxdef}\endBCmd}
+ \aftergroup\@afterindentfalse\aftergroup\@afterheading
+ }
+
+\newskip\BDefaboveskip
+\newskip\BDefbelowskip
+\newskip\BDefinlineskip
+\setlength\BDefaboveskip{0pt plus 2pt}% first-level list topsep
+\setlength\BDefbelowskip{10pt}
+\setlength\BDefinlineskip{6pt}
+
+\newenvironment{BCmd}{
+ \@beginparpenalty-\@lowpenalty
+ \topsep\BDefaboveskip
+ \fboxsep3pt
+ \flushleft}
+ {\@endparpenalty\@M
+ \@topsepadd\BDefbelowskip
+ \endflushleft}
+
+\newenvironment{BCmd*}{%
+ \@beginparpenalty\@M
+ \topsep\BDefinlineskip
+ \fboxsep3pt
+ \flushleft}
+ {\@endparpenalty5000
+ \endflushleft}
+
+\def\OptArgs{\colorbox{black!20}{\texttt{[Options]}}\kern1pt}
+\def\OptArg{\@ifnextchar*\OptArg@i{\OptArg@ii*}}% star version without braces
+\def\OptArg@i*#1{\colorbox{black!20}{\texttt{#1}}\kern1pt}
+\def\OptArg@ii*#1{\colorbox{black!20}{\texttt{[#1]}}\kern1pt}
+\def\DBS{{\ttfamily\textbackslash\textbackslash}}
+
+\newcommand\Larg [1]{{\normalfont\itshape#1\/}}
+\newcommand\Larga[1]{$\langle$\Larg{#1}$\rangle$}% angles
+\newcommand\Largb[1]{\lcb\Larg{#1}\rcb} % curly brace
+\newcommand\Largs[1]{\lsb\Larg{#1}\rsb} % square brackets
+\newcommand\Largr[1]{\lrb\Larg{#1}\rrb} % round brackets
+\newcommand\LBEG[1]{{\normalfont\ttfamily\bs{}begin\lcb#1\rcb}\xLenv{#1}}
+\newcommand\LmBEG[1]{{\normalfont\ttfamily\bs{}begin\lcb#1\rcb}\xLmenv{#1}}
+\newcommand\LEND[1]{{\normalfont\ttfamily\bs{}end\lcb#1\rcb}\xLenv{#1}}
+\newcommand\LmEND[1]{{\normalfont\ttfamily\bs{}end\lcb#1\rcb}\xLmenv{#1}}
+
+\DeclareRobustCommand\bs{{\normalfont\ttfamily\textbackslash}} % \let\bslash=\bs
+\DeclareRobustCommand\lcb{{\normalfont\ttfamily\textbraceleft}}
+\DeclareRobustCommand\rcb{{\normalfont\ttfamily\textbraceright}}
+\DeclareRobustCommand\lsb{{\normalfont\ttfamily[}}
+\DeclareRobustCommand\rsb{{\normalfont\ttfamily]}}
+\DeclareRobustCommand\lrb{{\normalfont\ttfamily(}}
+\DeclareRobustCommand\rrb{{\normalfont\ttfamily)}}
+\DeclareRobustCommand\false{{\ttfamily false}}
+\DeclareRobustCommand\true{{\ttfamily true}}
+
+
+\endinput
diff --git a/macros/latex/contrib/hvextern/doc/hvextern.pdf b/macros/latex/contrib/hvextern/doc/hvextern.pdf
index 963cef8772..2817fa93b8 100644
--- a/macros/latex/contrib/hvextern/doc/hvextern.pdf
+++ b/macros/latex/contrib/hvextern/doc/hvextern.pdf
Binary files differ
diff --git a/macros/latex/contrib/hvextern/doc/hvextern.tex b/macros/latex/contrib/hvextern/doc/hvextern.tex
index 0ad4419627..c26ac017a0 100644
--- a/macros/latex/contrib/hvextern/doc/hvextern.tex
+++ b/macros/latex/contrib/hvextern/doc/hvextern.tex
@@ -8,21 +8,29 @@
\usepackage{hvlogos}
\usepackage{hvextern}
+\usepackage{hvindex}
+\usepackage{hvdoctools}
\usepackage{listings}
\lstset{basicstyle=\ttfamily\small,language=[LaTeX]TeX,breaklines}
-\usepackage{xcolor}
+\usepackage{xcolor,xspace}
\usepackage{hyperref}
+
+\def\Python{\textsf{Python}\xspace}
+\def\Perl{\textsf{Perl}\xspace}
+\def\Lua{\textsf{Lua}\xspace}
+\def\Java{\textsf{Java}\xspace}
+
+
\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@dante.de}}
\maketitle
-
\tableofcontents
\newpage
-\setkeys{hv}{moveToExampleDir,ExampleDir=Examples}
+\setkeys{hv}{moveToExampleDir,ExampleDir=Examples,showFilename}
\section{Syntax}
\begin{verbatim}
@@ -46,10 +54,10 @@ 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.:
+The main document \emph{must} be run with the \Loption{-shell-escape} option, otherwise it won't work, e.g.:
\begin{verbatim}
-laulatex --shell-escape <file>
+lualatex --shell-escape <file>
\end{verbatim}
@@ -75,8 +83,8 @@ This document was run with \LuaLaTeX. Suppose you want to insert the output of a
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}.
+with \pdfLaTeX\ and the output is insert as pdf image. The \Index{source} code itself is not
+shown by the environment \Lenv{externalDocument}.
\begin{minipage}{.59\linewidth}
@@ -129,7 +137,7 @@ shown by the environment \texttt{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|:
+The \ttIndex{png} image is created on the fly with the following arguments of \Lenv{externalDocument}:
\begin{Verbatim}
\begin{externalDocument}[
@@ -154,7 +162,7 @@ The code which is declared as header and main can be marked by:
{\NumChar StopVisiblePreamble}
\end{Verbatim}
-\verb|\NumChar| is the default Python comment character \# and needs to be saved with a different
+\Lcs{NumChar} is the default Python comment character \#\index{\#} and needs to be saved with a different
catagory, which is done internally by the package. The complete definition of the code is:
@@ -206,7 +214,7 @@ image.save(imageName, "PNG")
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,
+internally extended by a consecutive number which isn't known to the \Index{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.
@@ -302,9 +310,9 @@ The marker for the code ranges which should be listed depend to the used program
\end{document}
\end{verbatim}
-everything between \verb|%StartVisiblePreamble| and \verb|%StopVisiblePreamble| will be listed as
+everything between \ttIndex{\%StartVisiblePreamble} and \ttIndex{\%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 with an own
+ \Lcs{begin\{document\}} and \Lcs{end\{document\}} as body. The marker must be defined with an own
macro, e.g.:
\begin{verbatim}
@@ -315,11 +323,14 @@ macro, e.g.:
{\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
+\Lcs{NumChar} is the comment character \#, which needs a special handling. This version of \Lpack{hvextern}
+supports the following programming languages (option \Lkeyword{compiler}):
+\Lkeyval{mpost}, \Lkeyval{tex}, \Lkeyval{latex}, \Lkeyval{luatex},
+\Lkeyval{python3}, \Lkeyval{perl}, \Lkeyval{lua}, \Lkeyval{xetex},
+\Lkeyval{pdflatex}, \Lkeyval{lualatex}, \Lkeyval{xelatex}, and \Lkeyval{context}. The default
+is \Lkeyval{pdflatex}. The option \Lkeyword{docType} selects the config file, which must be one of
+\Lkeyval{context}, \Lkeyval{lua}, \Lkeyval{pl}, \Lkeyval{tex}, \Lkeyval{latex},
+\Lkeyval{mp}, and \Lkeyval{py}. For Lua it is
\begin{verbatim}
\hv@extern@exampleType{lua}
@@ -330,7 +341,8 @@ context, lua, pl, tex, latex, mp, and py. For Lua it is
\end{verbatim}
-It defines the marker strings for the listed code sequences. In some cases you have to use multiple times the same value
+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}
@@ -339,12 +351,12 @@ ext=lua, compiler=lua, docType=lua, ...
\section{Optional arguments}
-The deafault setting is always shown in brackets.
+The default 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.
+rare cases needed. In general all used compilers will be found by the system. A given \Lkeyword{progpath}
+must be end with a slash, e.g. \Lkeyval{./bin/}
\begin{verbatim}
\define@key{hv}{progpath}[]{\def\hv@extern@progpath{#1}}
@@ -354,9 +366,9 @@ must be end with a slash, e.g. \texttt{./bin/} %The option \texttt{runsequence}
\end{verbatim}
Instead of the optional arguments
- \texttt{compiler}, \texttt{biber}, and \texttt{xindex} one can define an individual
+ \\Lkeyword{compiler}, \\Lkeyword{biber}, and \\Lkeyword{xindex} one can define an individual
command sequence by using the optional argument
- \texttt{runsequence}. It must be comma separated list:
+ \\Lkeyword{runsequence}. It must be comma separated list:
\begin{verbatim}
runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex}
@@ -398,8 +410,8 @@ Sort with xindex \verb|-l DE --config AU|
\end{externalDocument}
-The following Java-program creates the Mandelbrot set as png image. The valid setting for
-the environment \texttt{externalDocument} is:
+The following \Java-program creates the Mandelbrot set as png image. The valid setting for
+the environment \Lenv{externalDocument} is:
\begin{verbatim}
compiler=java,ext=java,docType=java,
@@ -480,7 +492,7 @@ public class Main {
\define@key{hv}{grfOptions}[]{\def\hv@extern@grfOptions{#1}}
\end{verbatim}
-The option is passed to \verb|\includegraphics|, e.g. \verb|angle=90,width=\linewidth| for
+The option is passed to \Lcs{includegraphics}, e.g. \verb|angle=90,width=\linewidth| for
the follwing example.
\begin{externalDocument}[grfOptions={angle=90,width=\linewidth},
@@ -516,8 +528,8 @@ the follwing example.
\define@key{hv}{lstOptions}[]{\def\hv@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
+The option is passed either to \Lcs{lstinputlisting}, or, if \Lkeyword{usefancyvrb} is active,
+to \Lcs{VerbatimInput}. The following example uses
\begin{verbatim}
lstOptions={basicstyle=\sffamily\itshape\scriptsize},
@@ -559,7 +571,7 @@ There are different colors for the preamble and body listing: the backgrund and
\define@key{hv}{BObody}[black8]{\def\hv@extern@BObody{#1}}
\end{verbatim}
-The options are passed to \verb|tcolorbox| and preset to \texttt{black12} and \texttt{black!8}.
+The options are passed to \Lpack{tcolorbox} and preset to \Lcolor{black12} and \Lcolor{black!8}.
The color of the frame is set to the same values, hence not seen. The following example uses
\begin{verbatim}
@@ -598,7 +610,7 @@ The color of the frame is set to the same values, hence not seen. The following
\subsection{Type of the source code}
-The current version of \texttt{hvextern} supports code written as
+The current version of \Lpack{hvextern} supports code written as
\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:
@@ -627,15 +639,15 @@ If a source needs more than running the defined compiler, it must be defined by
...}
\end{verbatim}
-The type of the source code can be different to the compiler, e.g. source \texttt{latex},
-but compiler \texttt{lualatex}.
+The type of the source code can be different to the compiler, e.g. source \Lkeyval{latex},
+but compiler \Lkeyval{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}.
+the keyword \Lkeyword{float}, a caption and a label are optional. The float type is always
+\Lenv{figure}.
\begin{verbatim}
\define@boolkey{hv}[hv@extern@]{float}[true]{}
@@ -696,7 +708,7 @@ The pages which should be printed can be defined by
\define@boolkey{hv}[hv@extern@]{frame}[true]{}
\end{verbatim}
-With \texttt{frame} the pages can be framed (internally by \verb|\fbox|).
+With \Lkeyword{frame} the pages can be framed (internally by \Lcs{fbox}).
It is leaved to the user to choose the correct image width for the pages.
The following example uses:
@@ -744,8 +756,8 @@ The following example uses:
\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}.
+Instead of using the \Index{documentclass} \Lcs{standalone}, which already crops the created PDF,
+one can use the optional argument \Lkeyword{crop}.
\begin{verbatim}
\define@boolkey{hv}[hv@extern@]{crop}[true]{}
@@ -755,7 +767,8 @@ one can use the optional argument \texttt{crop}.
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
+will have different heights after \Index{cropping} (see next image).
+The follwoing example was created with
\begin{verbatim}
pages={1,2,3},
@@ -802,20 +815,22 @@ will have different heights after cropping (see next image). The follwoing examp
\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.
+width of a minipage with \Lkeyword{mpwidth} greater than 0\,pt the output will be side by side.
\begin{verbatim}
\define@key{hv}{mpwidth}[0pt]{\setlength\hv@extern@mpwidth{#1}}
+\define@key{hv}{mpvalign}[0pt]{\def\hv@extern@mpvalign{#1}}
\end{verbatim}
-\texttt{mpwidth} is the width of the code. The rest of the line, minus 1em for the space between
+\Lkeyword{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.
+width for the output and will be calculated automatically. The two \Index{minipages} are
+aligned by defaults to its top. This can be changed by setting \Lkeyword{mpvalign} to \Lkeyval{c}
+or \Lkeyval{b}.
-\subsection{Align of the output}
+\subsection{Horizontal alignment of the output}
%\begin{verbatim}
%\define@key{hv}{align}[\centering]{\def\hv@extern@align{#1}}
@@ -965,7 +980,7 @@ aligned by its top.
\end{externalDocument}
\subsection{Inline images}
-By default code and image are own paragraphs. With the optional argument \texttt{inline} the created
+By default code and image are own paragraphs. With the optional argument \Lkeyword{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.
@@ -984,12 +999,12 @@ next Chinese characters
美好的一天
\end{document}
\end{externalDocument}
-are inserted as inline image without showing the code. The complete code looks like:
+are inserted as \Index{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
+With \Lkeyset{inline} the optional argument \Lkeyword{code} is automatically set to false. The
next Chinese characters
\begin{externalDocument}[
compiler=xelatex, inline, runs=2, grfOptions={height=8pt},
@@ -1015,9 +1030,9 @@ output as verbatim text by setting \verb|includegraphic=false|.
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
+\Lext{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
+\Index{Kaprekar} constants uses
\begin{verbatim}
my $filename = $0; # the current filename
@@ -1025,7 +1040,8 @@ $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
+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$.
@@ -1074,7 +1090,7 @@ close $fh;
%$
-Another example with running Lua to calculate and print the Pascal's triangle. The internal filename
+Another example with running \Lua to calculate and print the \Index{Pascal's triangle}. The internal filename
is available with
\begin{verbatim}
@@ -1133,7 +1149,7 @@ For a \LaTeX\ additional programs for bibliography, index, a.s.o. maybe needed.
\define@key{hv}{runsequence}[]{\def\hv@extern@runsequence{#1}}
\end{verbatim}
-The \texttt{biber} run needs no additional options, but for \texttt{xindex} it maybe useful.
+The \Lkeyword{biber} run needs no additional options, but for \Lkeyword{xindex} it maybe useful.
The following examples uses
\begin{verbatim}
@@ -1200,8 +1216,8 @@ Sort with xindex \verb|-l DE --config AU|
\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
+Instad of using the options \Lkeyword{compiler}, \Lkeyword{biber}, and \Lkeyword{xindex}
+one can also use only the optional argument \Lkeyword{runsequence} to define an individuell
sequence of commands, e.g.:
\begin{verbatim}
runsequence={lualatex,biber,{xindex -l de -c AU},lualatex,lualatex}
@@ -1258,7 +1274,7 @@ The default is using \verb|\lstinputlisting| for the printed code sequences.
% crop,
force,runs=2,code,docType=latex,
frame,
- lstOptions={columns=fixed}]{Schubert-A}
+ lstOptions={columns=fixed}]{voss}
%StartVisiblePreamble
\documentclass[chapterprefix=on,parskip=half-,DIV=12,fontsize=12pt]{scrbook}
\DeclareNewSectionCommand[
@@ -1307,7 +1323,7 @@ The default is using \verb|\lstinputlisting| for the printed code sequences.
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.
+it makes no difference using the optional argument \Lkeyword{usefancyvrb} or not.
\begin{externalDocument}[
@@ -1317,7 +1333,7 @@ it makes no difference using the optional argument \texttt{usefancyvrb} or not.
showFilename,
% crop,
force,runs=2,code,docType=latex,
- frame,usefancyvrb]{Schubert-A}
+ frame,usefancyvrb]{voss}
%StartVisiblePreamble
\documentclass[chapterprefix=on,parskip=half-,DIV=12,fontsize=12pt]{scrbook}
\DeclareNewSectionCommand[
@@ -1562,11 +1578,13 @@ already exists, there is no need to create it with the next run again and again.
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{tclbox=false}] Can be used if there are some negative interactions between package \texttt{listing}
+ and package \texttt{tcolorbox}.
\item[\texttt{eps}] create an eps from the pdf (historical)
\end{description}
-
+\printindex
\end{document}
diff --git a/macros/latex/contrib/hvextern/latex/hvextern.sty b/macros/latex/contrib/hvextern/latex/hvextern.sty
index 54a921e0a1..f728f941ae 100644
--- a/macros/latex/contrib/hvextern/latex/hvextern.sty
+++ b/macros/latex/contrib/hvextern/latex/hvextern.sty
@@ -11,8 +11,8 @@
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
-\def\hvexternFileversion{0.21}
-\ProvidesFile{hvextern}[2022/04/30 v\hvexternFileversion: package for running external documents (HV)]
+\def\hvexternFileversion{0.22}
+\ProvidesFile{hvextern}[2022/05/05 v\hvexternFileversion: package for running external documents (HV)]
\RequirePackage{shellesc,xkeyval,graphicx,marginnote,fancyvrb,tikz,listings,ifplatform}
\RequirePackage{tcolorbox,xparse}
@@ -48,6 +48,7 @@
\define@key{hv}{pages}[1]{\def\hv@extern@pages{#1}}
\define@key{hv}{cropmargin}[2]{\def\hv@extern@cropmargin{#1 }}
\define@key{hv}{mpwidth}[0pt]{\setlength\hv@extern@mpwidth{#1}}
+\define@key{hv}{mpvalign}[t]{\def\hv@extern@mpvalign{#1}}
\define@key{hv}{ext}[tex]{\def\hv@extern@ext{.#1}}
\define@boolkey{hv}[hv@extern@]{redirect}[true]{}
\define@boolkey{hv}[hv@extern@]{usefancyvrb}[true]{}
@@ -55,6 +56,7 @@
\define@boolkey{hv}[hv@extern@]{code}[true]{}
\define@boolkey{hv}[hv@extern@]{force}[true]{}
\define@boolkey{hv}[hv@extern@]{crop}[true]{}
+\define@boolkey{hv}[hv@extern@]{tcbox}[true]{}
\define@boolkey{hv}[hv@extern@]{biber}[true]{}
\define@boolkey{hv}[hv@extern@]{xindex}[true]{}
\define@key{hv}{xindexOptions}[]{\def\hv@extern@xindexOptions{#1}}
@@ -96,6 +98,7 @@
crop=false,% erzeugte PDF "croppen"
compiler=pdflatex,% zu verwendener Compiler
redirect=false,% write output into a file *.txt
+ tcbox=true,% use tcolorbox
grfOptions={},% Optionen der einzubindenden Grafik
lstOptions={},% Optionen für das Listing
BGpreamble=black!12,% Backgroundcolor for preamble
@@ -121,12 +124,14 @@
ExampleDir=Examples,% Unterverzeichnis für Beispiele
align=\centering,% Ausgabe zentrieren
mpwidth=0pt,% no minipage
+ mpvalign=t,% if side by side output the vertical alignment
usefancyvrb=false,% use VerbatimInput instead of listings
progpath={},
cropmargin=2,% 2pb margin
eps=false,% create an eps output?
- }
+ }%
}
+
\ResetKeys
{\catcode`\%=12
@@ -157,13 +162,33 @@
\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\PreambleVerbatim[2][]{%
+ \ifhv@extern@tcbox
+ \begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}%
+ \else
+ \VerbatimInput[#1]{#2}
+ \fi}
-\newcommand\BodyVerbatim[2][]{\begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}}
+\newcommand\BodyVerbatim[2][]{%
+ \ifhv@extern@tcbox
+ \begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}%
+ \else
+ \VerbatimInput[#1]{#2}
+ \fi}
-\newcommand\PreambleListing[2][]{\begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}}
+\newcommand\PreambleListing[2][]{%
+ \ifhv@extern@tcbox
+ \begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}%
+ \else
+ \expandafter\lstinputlisting\expandafter[#1]{#2}%
+ \fi}
-\newcommand\BodyListing[2][]{\begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}}
+\newcommand\BodyListing[2][]{%
+ \ifhv@extern@tcbox
+ \begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}%
+ \else
+ \expandafter\lstinputlisting\expandafter[#1]{#2}%
+ \fi}
\newcounter{hv@example@counter}
@@ -339,7 +364,7 @@
\ifhv@extern@code%-------------- Code Part
\par\noindent
\begingroup
- \ifdim\hv@extern@mpwidth>\z@ \minipage[t]{\hv@extern@mpwidth}\vspace{0pt}\fi
+ \ifdim\hv@extern@mpwidth>\z@ \minipage[\hv@extern@mpvalign]{\hv@extern@mpwidth}\vspace{0pt}\fi
\ifhv@extern@usefancyvrb
\@nameuse{\hv@extern@docType @initPreambleFancy}%
\edef\@@@temp{\@nameuse{\hv@extern@docType @initPreamble}}%
@@ -399,7 +424,7 @@
\else
\hv@typeout{>>>> No floating environment}%
\ifdim\hv@extern@mpwidth>\z@
- \hfill\minipage[t]{\dimexpr\linewidth-\hv@extern@mpwidth-1em\relax}\vspace{0pt}%
+ \hfill\minipage[\hv@extern@mpvalign]{\dimexpr\linewidth-\hv@extern@mpwidth-1em\relax}\vspace{0pt}%
\else
\par\noindent\begingroup
\fi