From af956ba2c2710e269fb7eed018809aa08da5bd40 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 28 Apr 2022 03:00:36 +0000 Subject: CTAN sync 202204280300 --- macros/latex/contrib/hvextern/doc/hvextern.pdf | Bin 1041665 -> 1148759 bytes macros/latex/contrib/hvextern/doc/hvextern.tex | 134 +++++++++++++++++++++---- 2 files changed, 116 insertions(+), 18 deletions(-) (limited to 'macros/latex/contrib/hvextern/doc') diff --git a/macros/latex/contrib/hvextern/doc/hvextern.pdf b/macros/latex/contrib/hvextern/doc/hvextern.pdf index 99a251a6e8..bdefe9bd89 100644 Binary files a/macros/latex/contrib/hvextern/doc/hvextern.pdf and b/macros/latex/contrib/hvextern/doc/hvextern.pdf differ diff --git a/macros/latex/contrib/hvextern/doc/hvextern.tex b/macros/latex/contrib/hvextern/doc/hvextern.tex index 8acd4e841c..50d93cef06 100644 --- a/macros/latex/contrib/hvextern/doc/hvextern.tex +++ b/macros/latex/contrib/hvextern/doc/hvextern.tex @@ -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 @@ The purpose for this package is to show the output of documents which have to be 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 png image is created on the fly with the following arguments of \verb|exter The code which is declared as header and main can be marked by: \begin{Verbatim} -\extern@ExampleType{py} +\hv@extern@exampleType{py} {\NumChar StartVisibleMain} {\NumChar StopVisibleMain} {\NumChar StartVisiblePreamble} @@ -296,11 +306,11 @@ The marker for the code ranges which should be listed depend to the used program 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@ExampleType{py} +\hv@extern@exampleType{py} {\NumChar StartVisibleMain} {\NumChar StopVisibleMain} {\NumChar StartVisiblePreamble} @@ -314,7 +324,7 @@ is pdflatex. The option \texttt{docType} selects the config file, which must be context, lua, pl, tex, latex, mp, and py. For Lua it is \begin{verbatim} -\extern@ExampleType{lua} +\hv@extern@exampleType{lua} {--StartVisibleMain} {--StopVisibleMain} {--StartVisiblePreamble} @@ -336,7 +346,7 @@ The deafault setting is always shown in brackets. 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@key{hv}{progpath}[]{\def\hv@extern@progpath{#1}} @@ -345,6 +355,54 @@ must be end with a slash, e.g. \texttt{./bin/} The option \texttt{runsequence} i \define@key{hv}{runs}[1]{\setcounter{hv@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@key{hv}{grfOptions}[]{\def\hv@extern@grfOptions{#1}} @@ -469,12 +527,12 @@ 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 -\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@ExampleType{latex}% for _all_LaTeX engines +\hv@extern@exampleType{latex}% for _all_LaTeX engines {\string\begin\string{document\string}}% {\string\end\string{document\string}}% {\perCent StartVisiblePreamble}% @@ -1000,6 +1058,7 @@ For a \LaTeX\ additional programs for bibliography, index, a.s.o. maybe needed. \define@boolkey{hv}[hv@extern@]{biber}[true]{} \define@boolkey{hv}[hv@extern@]{xindex}[true]{} \define@key{hv}{xindexOptions}[]{\def\hv@extern@xindexOptions{#1}} +\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. @@ -1007,13 +1066,9 @@ The following examples uses \begin{verbatim} \begin{externalDocument}[ - compiler=lualatex, runs=2, - pages=2, - crop, - xindex, - xindexOptions={-l DE --config AU}, - mpwidth=0.6\linewidth, - usefancyvrb=false, + compiler=lualatex, runs=2, pages=2,crop, + xindex, xindexOptions={-l DE --config AU}, + mpwidth=0.6\linewidth, usefancyvrb=false, docType=latex, ... ]{voss} @@ -1073,6 +1128,48 @@ 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 +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} + @@ -1301,12 +1398,13 @@ This is the start of the introduction. 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} -- cgit v1.2.3