summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/hvextern
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-05-08 20:23:52 +0000
committerKarl Berry <karl@freefriends.org>2022-05-08 20:23:52 +0000
commitb14d6227d79a3ba7ba5297db42ae5c14c02075bd (patch)
tree1575330b7a6021214ef1bedcece5eb2546d9f326 /Master/texmf-dist/doc/latex/hvextern
parent6b0dba844eeab4f1d26d299a162e71a3405ffc36 (diff)
hvextern (8may22)
git-svn-id: svn://tug.org/texlive/trunk@63260 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/hvextern')
-rw-r--r--Master/texmf-dist/doc/latex/hvextern/Changes3
-rw-r--r--Master/texmf-dist/doc/latex/hvextern/hvdoctools.sty100
-rw-r--r--Master/texmf-dist/doc/latex/hvextern/hvextern.pdfbin1185723 -> 1202031 bytes
-rw-r--r--Master/texmf-dist/doc/latex/hvextern/hvextern.tex242
4 files changed, 241 insertions, 104 deletions
diff --git a/Master/texmf-dist/doc/latex/hvextern/Changes b/Master/texmf-dist/doc/latex/hvextern/Changes
index 9c754a92770..0204c888fb2 100644
--- a/Master/texmf-dist/doc/latex/hvextern/Changes
+++ b/Master/texmf-dist/doc/latex/hvextern/Changes
@@ -1,5 +1,8 @@
hvextern.sty ----------------
+v 0.23 2022-05-08 - added \runExtCmd
+ - added doctype shell
+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/Master/texmf-dist/doc/latex/hvextern/hvdoctools.sty b/Master/texmf-dist/doc/latex/hvextern/hvdoctools.sty
new file mode 100644
index 00000000000..23ff524a9aa
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/hvextern/hvdoctools.sty
@@ -0,0 +1,100 @@
+%% $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)}\index{Keyword!#1@\texttt{#1}}}
+\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}}}
+
+\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}}}
+\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
+ }
+\def\Lclass#1{\texttt{#1}\index{#1@\texttt{#1} (doc class)}}
+
+\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/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf b/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
index 963cef8772d..c521b487eac 100644
--- a/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
+++ b/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/hvextern/hvextern.tex b/Master/texmf-dist/doc/latex/hvextern/hvextern.tex
index 0ad44196277..8c104803e6a 100644
--- a/Master/texmf-dist/doc/latex/hvextern/hvextern.tex
+++ b/Master/texmf-dist/doc/latex/hvextern/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,verbose}
\section{Syntax}
\begin{verbatim}
@@ -36,7 +44,7 @@ it into the main \LaTeX\ document.
\end{sloppypar}
-There is only one environment:
+There is only one environment and one command:
\begin{verbatim}
\begin{externalDocument}[<options>]{<external filename without extension>}
@@ -44,12 +52,14 @@ There is only one environment:
source code
...
\end{externalDocument}
+
+\runExtCmd[<options>]{<command with arguments>}{<external filename without extension>}
\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}
@@ -63,7 +73,7 @@ automatically in the main document..
\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.
+with \texttt{lualatex} with the \texttt{-\kern1pt-shell-escape} option.
\end{minipage}}
@@ -75,8 +85,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}
@@ -106,7 +116,7 @@ shown by the environment \texttt{externalDocument}.
\end{minipage}
\begin{minipage}{.39\linewidth}
\begin{externalDocument}[
- compiler=pdflatex,force,cleanup={log,aux},verbose]{voss}
+ compiler=pdflatex,force=false,cleanup={log,aux},verbose]{voss}
\documentclass{standalone}
%StartVisiblePreamble
\usepackage{fontenc}
@@ -129,7 +139,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 +164,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:
@@ -164,7 +174,7 @@ catagory, which is done internally by the package. The complete definition of th
showFilename,
code,
ext=py,
- force,
+ force=false,
docType=py,
usefancyvrb,
grfOptions={width=\linewidth}]{python}
@@ -206,7 +216,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.
@@ -214,7 +224,7 @@ line in the above code shows how it can be done with Python.
\begin{externalDocument}[
compiler=python3,
progpath=/usr/local/bin/,
- force,
+ force=false,
showFilename,
runs=1,
code,
@@ -263,7 +273,7 @@ image.save(imageName+".png", "PNG")
\begin{externalDocument}[grfOptions={width=0.95\linewidth},
compiler=xelatex,code,mpwidth=0.6\linewidth,
- crop,cleanup,force,usefancyvrb=false,ext=tex]{voss}
+ crop,cleanup,force=false,usefancyvrb=false,ext=tex]{voss}
\documentclass{article}
%StartVisiblePreamble
\usepackage{tikz}
@@ -302,9 +312,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 +325,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 +343,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 +353,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.
+The \Lkeyword{progpath} should only in some
+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 +368,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}
@@ -369,7 +383,7 @@ runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex}
runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex},
showFilename,
verbose,
- force,
+ force=false,
cleanup={log,aux,toc,bbl,blg},
code,docType=latex,
lstOptions={columns=fixed}]{voss}
@@ -398,8 +412,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,
@@ -408,7 +422,7 @@ the environment \texttt{externalDocument} is:
\begin{externalDocument}[
verbose,
compiler=java,ext=java,code,
- force,docType=java,includegraphic,
+ force=false,docType=java,includegraphic,
usefancyvrb,grfOptions={width=0.9\linewidth}]{java}
import java.awt.Color;
import java.awt.Graphics;
@@ -472,7 +486,7 @@ public class Main {
\end{externalDocument}
-
+%$
\subsection{Grafik options}
@@ -480,7 +494,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 +530,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},
@@ -533,7 +547,7 @@ to \verb|\VerbatimInput|. The following example uses
mpwidth=0.6\linewidth,
crop,
cleanup,
- force,
+ force=false,
docType=latex]{voss}
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
@@ -559,7 +573,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{black"!12} and \Lcolor{black"!8}.
The color of the frame is set to the same values, hence not seen. The following example uses
\begin{verbatim}
@@ -579,7 +593,7 @@ The color of the frame is set to the same values, hence not seen. The following
mpwidth=0.6\linewidth,
crop,
cleanup,
- force,
+ force=false,
usefancyvrb,
docType=latex]{voss}
\RequirePackage{pdfmanagement-testphase}
@@ -598,7 +612,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 +641,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]{}
@@ -656,7 +670,7 @@ The image Figure~\ref{img:cox} shows an example for a floting object.
% mpwidth=0.6\linewidth,
crop,
cleanup,
- force,
+ force=false,
usefancyvrb,
float,
caption={An example for Coxeter images},
@@ -696,7 +710,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:
@@ -718,7 +732,7 @@ The following example uses:
% mpwidth=0.6\linewidth,
% crop,
cleanup,
- force,
+ force=false,
frame,
% usefancyvrb,
% float,
@@ -744,8 +758,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} \Lclass{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 +769,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},
@@ -776,7 +791,7 @@ will have different heights after cropping (see next image). The follwoing examp
% mpwidth=0.6\linewidth,
crop, cropmargin=5,
cleanup,
- force,
+ force=false,
frame,
% usefancyvrb,
% float,
@@ -802,20 +817,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}}
@@ -834,7 +851,7 @@ aligned by its top.
code,
crop,
cleanup,
- force,
+ force=false,
docType=latex]{voss}
\documentclass{article}
\pagestyle{empty}
@@ -857,7 +874,7 @@ aligned by its top.
code,
crop,
cleanup,
- force,
+ force=false,
docType=latex]{voss}
\documentclass{article}
\pagestyle{empty}
@@ -881,7 +898,7 @@ aligned by its top.
code,
crop,
cleanup,
- force,
+ force=false,
docType=latex]{voss}
\documentclass{article}
\pagestyle{empty}
@@ -905,7 +922,7 @@ aligned by its top.
code,
crop,
cleanup,
- force,
+ force=false,
mpwidth=0.5\linewidth,
docType=latex]{voss}
\documentclass{article}
@@ -929,7 +946,7 @@ aligned by its top.
code,
crop,
cleanup,
- force,
+ force=false,
mpwidth=0.5\linewidth,
docType=latex]{voss}
\documentclass{article}
@@ -954,7 +971,7 @@ aligned by its top.
code,
crop,
cleanup,
- force,
+ force=false,
mpwidth=0.5\linewidth,
docType=latex]{voss}
\documentclass{article}
@@ -965,35 +982,35 @@ 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
-image can be part of the current line. This may make sense, if you need characters which are
+By default code and image are own paragraphs. With the optional argument \Lkeyword{inline} the created
+image can be part of the \Index{current line}. This may make sense, if you need characters which are
not part of your current font.
\begin{verbatim}
\define@boolkey{hv}[hv@extern@]{inline}[true]{\hv@extern@codefalse}
\end{verbatim}
-With \texttt{inline=true} the optional argument \texttt{code} is automatically set to false. The
+With the setting \LKeyset{inline=true} the optional keyword \Lkeyword{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}%
+ crop, cropmargin=0, cleanup, force=false, 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:
+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},
- crop, cropmargin=0, cleanup, force, docType=latex]{voss}
+ crop, cropmargin=0, cleanup, force=false, docType=latex]{voss}
\documentclass{ctexart}
\pagestyle{empty}
\begin{document}
@@ -1005,9 +1022,9 @@ are inserted as inline image without showing the code. The complete code looks l
\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|.
+By default the created pdf which can be, of course, only text, will be inserted by \Lcs{includegraphics}.
+If you have only text as output and don't want to create a pdf you can insert this kind of
+output as verbatim text by setting \Lkeyset{includegraphic=false}.
\begin{verbatim}
\define@boolkey{hv}[hv@extern@]{includegraphic}[true]{}
@@ -1015,9 +1032,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,12 +1042,13 @@ $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$.
\begin{externalDocument}[
- compiler=perl, force, docType=pl, ext=pl, includegraphic=false,
+ compiler=perl, force=false, docType=pl, ext=pl, includegraphic=false,
code, mpwidth=0.6\linewidth]{voss}
#!/usr/bin/perl
#
@@ -1074,7 +1092,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}
@@ -1085,7 +1103,7 @@ outFile = io.open(shortFN..".txt","w+") -- open external file
\begin{externalDocument}[
- compiler=lua, force, docType=lua, ext=lua, includegraphic=false, code, usefancyvrb=false]{voss}
+ compiler=lua, force=false, docType=lua, ext=lua, includegraphic=false, code, usefancyvrb=false]{voss}
#!/usr/bin/env lua
local filename = arg[0]
local shortFN = filename:match("(.+)%..+")
@@ -1124,7 +1142,7 @@ outFile:close()
\subsection{Running additional external programs}
-For a \LaTeX\ additional programs for bibliography, index, a.s.o. maybe needed.
+For a \LaTeX\ additional programs for \Index{bibliography}, \Index{index}, a.s.o. maybe needed.
\begin{verbatim}
\define@boolkey{hv}[hv@extern@]{biber}[true]{}
@@ -1133,7 +1151,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}
@@ -1158,7 +1176,7 @@ The following examples uses
pages=2,
crop,
cleanup,
- force,
+ force=false,
xindex,
xindexOptions={-l DE --config AU},
mpwidth=0.6\linewidth,
@@ -1200,8 +1218,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}
@@ -1214,7 +1232,7 @@ runsequence={lualatex,biber,{xindex -l de -c AU},lualatex,lualatex}
runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex},
showFilename,
verbose,
- force,
+ force=false,
cleanup={log,aux,toc,bbl,blg},
code,docType=latex,
lstOptions={columns=fixed}]{voss}
@@ -1248,7 +1266,7 @@ Sort with xindex \verb|-l DE --config AU|
\subsection{Using \texttt{listings}}
-The default is using \verb|\lstinputlisting| for the printed code sequences.
+The default is using \Lcs{lstinputlisting} for the printed code sequences.
\begin{externalDocument}[
grfOptions={width=0.45\linewidth},
@@ -1256,9 +1274,9 @@ The default is using \verb|\lstinputlisting| for the printed code sequences.
frame,compiler=pdflatex,
showFilename,
% crop,
- force,runs=2,code,docType=latex,
+ force=false,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[
@@ -1306,8 +1324,8 @@ 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 also possible to use \Lcs{VerbatimInput} from package \Lpack{fancyvrb}. In general
+it makes no difference using the optional argument \Lkeyword{usefancyvrb} or not.
\begin{externalDocument}[
@@ -1316,8 +1334,8 @@ it makes no difference using the optional argument \texttt{usefancyvrb} or not.
frame,compiler=pdflatex,
showFilename,
% crop,
- force,runs=2,code,docType=latex,
- frame,usefancyvrb]{Schubert-A}
+ force=false,runs=2,code,docType=latex,
+ frame,usefancyvrb]{voss}
%StartVisiblePreamble
\documentclass[chapterprefix=on,parskip=half-,DIV=12,fontsize=12pt]{scrbook}
\DeclareNewSectionCommand[
@@ -1376,7 +1394,7 @@ it makes no difference using the optional argument \texttt{usefancyvrb} or not.
compiler=mpost,
showFilename,
% crop,
- force,
+ force=false,
cleanup,
code,
docType=mp,
@@ -1408,7 +1426,7 @@ end;
compiler=tex,
showFilename,
% crop,
- force,
+ force=false,
code,
docType=tex,
ext=tex,]{voss}
@@ -1472,7 +1490,7 @@ This is the start of the introduction.
compiler=lualatex,
showFilename,
crop,
- force,
+ force=false,
code,
docType=latex,
ext=tex,]{voss}
@@ -1512,7 +1530,7 @@ This is the start of the introduction.
compiler=context,
showFilename,
runs=2,
- force,
+ force=false,
code,
docType=context,
ext=tex,]{voss}
@@ -1553,20 +1571,36 @@ foo
\end{externalDocument}
+\section{Running external commands}
+Integrating the current directory of this document we can use the macro \Lcs{runExtCmd} with
+the optional argument \Lkeyword{redirect}
+
+\begin{verbatim}
+\runExtCmd[redirect]{ls -la}{voss}
+\end{verbatim}
+
+to get the directory listed:
+
+\medskip
+\runExtCmd[redirect,verbose]{ls -la}{voss}
+
+
\section{Other options}
\begin{description}
-\item[\texttt{force=false}] can speed up the comiling time for the document. If a created image/output
+\item[\Lkeyset{force=false}] can speed up the comiling time for the document. If a created image/output
already exists, there is no need to create it with the next run again and again.
-\item[\texttt{cleanup}] the auxiliary files of a \LaTeX-run are deleted, preset to \texttt{.aux}, \texttt{.log}.
+\item[\Lkeyword{cleanup}] the auxiliary files of a \LaTeX-run are deleted, preset to \texttt{aux}, \texttt{log}.
It must be a comma seperated list of the extensions of the main file, s.g. \texttt{cleanup=\{aux,log\}}.
-\item[\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)
+\item[\Lkeyword{copyToExampleDir}] name of a directory for the examples, must first be created by the user himself
+\item[\Lkeyword{ExamplesDir}] move all examples into a directory
+\item[\Lkeyset{tclbox=false}] Can be used if there are some negative interactions between package \Lpack{listings}
+ and package \Lpack{tcolorbox}.
+\item[\Lkeyword{eps}] create an eps from the pdf (historical).
\end{description}
-
+\printindex
\end{document}