diff options
author | Karl Berry <karl@freefriends.org> | 2022-04-25 20:27:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-04-25 20:27:47 +0000 |
commit | d42a17ef166f6fb56569aa1522f50a6f646a019f (patch) | |
tree | 1061ea8e2a3f83287e6c6852050a9fe57e9b6bc1 /Master/texmf-dist/tex/latex/hvextern | |
parent | 23a967a57e6365d4b02cc0540915e6aa92c39860 (diff) |
hvextern (25apr22)
git-svn-id: svn://tug.org/texlive/trunk@63140 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hvextern')
8 files changed, 518 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg b/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg new file mode 100644 index 00000000000..f45cc861537 --- /dev/null +++ b/Master/texmf-dist/tex/latex/hvextern/hvextern-context.cfg @@ -0,0 +1,22 @@ +%% This is file `hvextern-ctx.cfg', +%% +%% Copyright (C) 2016-22 Herbert Voß hvoss@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@ExampleType{context} + {\string\starttext} + {\string\stoptext} + {\perCent StartVisiblePreamble} + {\perCent StopVisiblePreamble} + +\endinput diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg b/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg new file mode 100644 index 00000000000..8f186f9e58f --- /dev/null +++ b/Master/texmf-dist/tex/latex/hvextern/hvextern-latex.cfg @@ -0,0 +1,31 @@ +%% This is file `hvextern-mp.cfg', +%% +%% Copyright (C) 2016-22 Herbert Voß hvoss@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@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@extern@runLATEX#1#2#3#4{% path compiler file extension + \ifhv@extern@verbose \typeout{>>>> running #1#2 #3#4}\fi + \ShellEscape{#1#2\space #3#4}% + \ifhv@extern@verbose \typeout{>>>> running #1dvips #3}\fi + \ShellEscape{#1dvips\space #3.dvi}% + \ifhv@extern@verbose \typeout{>>>> running ps2pdf #3.ps}\fi + \ShellEscape{#1ps2pdf\space -dAutoRotatePages=/None\space -dALLOWPSTRANSPARENCY\space #3.ps}% +} +\endinput diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg b/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg new file mode 100644 index 00000000000..85a3ee6920f --- /dev/null +++ b/Master/texmf-dist/tex/latex/hvextern/hvextern-lua.cfg @@ -0,0 +1,22 @@ +%% This is file `hvextern-lua.cfg', +%% +%% Copyright (C) 2016-22 Herbert Voß hvoss@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@ExampleType{lua} + {--StartVisibleMain} + {--StopVisibleMain} + {--StartVisiblePreamble} + {--StopVisiblePreamble} + +\endinput diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg b/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg new file mode 100644 index 00000000000..9e42167f9cd --- /dev/null +++ b/Master/texmf-dist/tex/latex/hvextern/hvextern-mp.cfg @@ -0,0 +1,32 @@ +%% This is file `hvextern-mp.cfg', +%% +%% Copyright (C) 2016-22 Herbert Voß hvoss@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@ExampleType{mp} + {beginfig(1)} + {endfig;} + {\perCent StartVisiblePreamble} + {\perCent StopVisiblePreamble} + +\def\hv@extern@runMP#1#2#3#4{% path compiler file extension + \ifhv@extern@verbose \typeout{>>>> running #1#2 #3#4}\fi + \ShellEscape{#1#2\space -tex=tex\space #3#4}% + \ifhv@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@extern@verbose \typeout{>>>> running #1dvips #3}\fi + \ShellEscape{#1dvips\space -j\space -E\space -o\space #3.eps\space epsf.dvi}% + \ifhv@extern@verbose \typeout{>>>> running #1epstopdf #3}\fi + \ShellEscape{#1epstopdf\space #3.eps}% +} +\endinput diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg b/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg new file mode 100644 index 00000000000..656f2d81776 --- /dev/null +++ b/Master/texmf-dist/tex/latex/hvextern/hvextern-pl.cfg @@ -0,0 +1,22 @@ +%% This is file `hvextern-pl.cfg', +%% +%% Copyright (C) 2016-22 Herbert Voß hvoss@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@ExampleType{pl} + {\NumChar StartVisibleMain} + {\NumChar StopVisibleMain} + {\NumChar StartVisiblePreamble} + {\NumChar StopVisiblePreamble} + +\endinput diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg b/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg new file mode 100644 index 00000000000..eaf51f8212a --- /dev/null +++ b/Master/texmf-dist/tex/latex/hvextern/hvextern-py.cfg @@ -0,0 +1,27 @@ +%% This is file `hvextern-py.cfg', +%% +%% Copyright (C) 2016-22 Herbert Voß hvoss@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@ExampleType{py} + {\NumChar StartVisibleMain} + {\NumChar StopVisibleMain} + {\NumChar StartVisiblePreamble} + {\NumChar StopVisiblePreamble} + +%\def\hv@extern@runPYTHON#1#2#3#4{% path compiler file extension +% \ifhv@extern@verbose \typeout{>>>> running #1#2 #3#4}\fi +% \ShellEscape{#1python2\space #3#4}% for special version +%} + +\endinput diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg b/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg new file mode 100644 index 00000000000..2baf3552f8b --- /dev/null +++ b/Master/texmf-dist/tex/latex/hvextern/hvextern-tex.cfg @@ -0,0 +1,30 @@ +%% This is file `hvextern-mp.cfg', +%% +%% Copyright (C) 2016-22 Herbert Voß hvoss@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@ExampleType{tex} + {\perCent StartBody} + {\string\bye} + {\perCent StartVisiblePreamble} + {\perCent StopVisiblePreamble} + +\def\hv@extern@runTEX#1#2#3#4{% path compiler file extension + \ifhv@extern@verbose \typeout{>>>> running #1#2 #3#4}\fi + \ShellEscape{#1tex\space #3#4}% + \ifhv@extern@verbose \typeout{>>>> running #1dvips #3}\fi + \ShellEscape{#1dvips\space #3.dvi}% + \ifhv@extern@verbose \typeout{>>>> running ps2pdf #3.ps}\fi + \ShellEscape{#1ps2pdf\space -dAutoRotatePages=/None\space -dALLOWPSTRANSPARENCY\space #3.ps}% +} +\endinput diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern.sty b/Master/texmf-dist/tex/latex/hvextern/hvextern.sty new file mode 100644 index 00000000000..201f4ef7b11 --- /dev/null +++ b/Master/texmf-dist/tex/latex/hvextern/hvextern.sty @@ -0,0 +1,332 @@ +%% This is file `hvextern.sty', +%% +%% Copyright (C) 2016-22 +%% Herbert Voss +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. + +\def\hvexternFileversion{0.19} +\ProvidesFile{hvextern}[2022/04/23 v\hvexternFileversion: package for running external documents (HV)] + +\RequirePackage{shellesc,xkeyval,graphicx,marginnote,fancyvrb,tikz,listings,ifplatform} +\RequirePackage{tcolorbox} +\tcbuselibrary{skins,breakable} + +\ifwindows + \def\hv@move{move }% + \def\hv@rm{del }% +\else + \def\hv@move{mv } + \def\hv@rm{rm } +\fi + +\newcounter{hv@extern@runs} +\newcounter{@@@runs} +\newsavebox\hv@extern@box +\newlength\LineWidth +\AtBeginDocument{\setlength\LineWidth{\dimexpr\linewidth-2\fboxsep-2\fboxrule}} +\newlength\hv@extern@mpwidth \setlength\hv@extern@mpwidth{\z@} + +\define@key{hv}{progpath}{\def\hv@extern@progpath{#1}} +\define@key{hv}{runsequence}[]{\def\hv@extern@runsequence{#1}} +\define@key{hv}{runs}[1]{\setcounter{hv@extern@runs}{#1}} +\define@key{hv}{grfOptions}[]{\def\hv@extern@grfOptions{#1}} +\define@key{hv}{lstOptions}[]{\def\hv@extern@lstOptions{#1}} +\define@key{hv}{BGpreamble}[black!12]{\def\hv@extern@BGpreamble{#1}} +\define@key{hv}{BGbody}[black!8]{\def\hv@extern@BGbody{#1}} +\define@key{hv}{BOpreamble}[black!12]{\def\hv@extern@BOpreamble{#1}} +\define@key{hv}{BObody}[black!8]{\def\hv@extern@BObody{#1}} +\define@key{hv}{docType}[latex]{\def\hv@extern@docType{#1}} +\define@key{hv}{caption}[]{\def\hv@extern@caption{#1}} +\define@key{hv}{label}[]{\def\hv@extern@label{#1}} +\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}{ext}[tex]{\def\hv@extern@ext{.#1}} +\define@boolkey{hv}[hv@extern@]{usefancyvrb}[true]{} +\define@boolkey{hv}[hv@extern@]{showFilename}[true]{} +\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@]{biber}[true]{} +\define@boolkey{hv}[hv@extern@]{xindex}[true]{} +\define@key{hv}{xindexOptions}[]{\def\hv@extern@xindexOptions{#1}} +\define@boolkey{hv}[hv@extern@]{includegraphic}[true]{} +\define@boolkey{hv}[hv@extern@]{inline}[true]{\hv@extern@codefalse} +\define@boolkey{hv}[hv@extern@]{frame}[true]{} +\define@boolkey{hv}[hv@extern@]{float}[true]{} +%\define@boolkey{hv}[hv@extern@]{cleanup}[true]{} +\define@key{hv}{cleanup}[{aux,log}]{\def\hv@extern@cleanup{#1}}% +\define@boolkey{hv}[hv@extern@]{moveToExampleDir}[true]{} +\define@key{hv}{align}[\centering]{\def\hv@extern@align{#1}} +\define@key{hv}{ExampleDir}[Examples]{% + \ifhv@extern@moveToExampleDir + \def\hv@extern@ExamplesDir{#1/}% + \else + \def\hv@extern@ExamplesDir{}% + \fi +} +\define@boolkey{hv}[hv@extern@]{eps}[true]{} +\define@boolkey{hv}[hv@extern@]{verbose}[true]{} +\def\hv@typeout#1{\ifhv@extern@verbose\typeout{#1}\fi} + +%\define@key{hv}{compiler}[pdflatex]{\def\hv@extern@compiler{#1}} +\define@choicekey*+{hv}{compiler}[\val\nr]{mpost,tex,latex,luatex,python3,perl,lua,xetex,pdflatex,lualatex,xelatex,context}[pdflatex]{% +% \hv@typeout{>>>> Compiler type \nr}% + \def\hv@extern@compiler{\val}% + \edef\hv@extern@compilerNo{\nr}% +}{\PackageWarning{hvextern}{erroneous input (#1) for compiler ignored. Using pdflatex.}% + \def\hv@extern@compiler{pdflatex}% + \def\hv@extern@compilerNo{6}% + } + +\def\ResetKeys{% + \setkeys{hv}{ + showFilename=false,% Dateinamen im Rand angeben + ext=tex,% file extension + code=false,% show Code + crop=false,% erzeugte PDF "croppen" + compiler=pdflatex,% zu verwendener Compiler + grfOptions={},% Optionen der einzubindenden Grafik + lstOptions={},% Optionen für das Listing + BGpreamble=black!12,% Backgroundcolor for preamble + BGbody=black!8,% Backgroundcolor for body + BOpreamble=black!12,% Bodercolor for preamble + BObody=black!8,% Bodercolor for body + includegraphic=true,% Grafik einbinden oder User überlassen + inline=false,% Grafik nicht in derselben Zeile + runs=1,% Anzahl Compiler-Durchläufe + runsequence={},% Im Moment nicht aktiv + biber=false,% Biber laufen lassen? + xindex=false,% xindex laufen lassen? + xindexOptions={},% options for xindex + force=false,% Compiler, auch wenn PDF existiert? + frame=false,% keinen Rahmen um Abbildung + float=false,% nicht als Gleitumgebung + caption=,% keine Caption + label=,% kein Label + pages=1,% welche Seiten auszugeben sind + docType=latex,% LaTeX example Code + cleanup={},% Hilfsdateien nicht löschen + moveToExampleDir=false,% Verschieben nach ExamplesDir + ExampleDir=Examples,% Unterverzeichnis für Beispiele + align=\centering,% Ausgabe zentrieren + mpwidth=0pt,% no minipage + usefancyvrb=false,% use VerbatimInput instead of listings + progpath={}, + cropmargin=2,% 2pb margin + eps=false,% create an eps output? + } +} +\ResetKeys + +{\catcode`\%=12 + \catcode`\#=12 + \gdef\perCent{%} + \gdef\DoubleperCent{%%} + \gdef\NumChar{#} + \gdef\DoubleNumChar{##} +} + +\def\run@hv@extern@cleanup#1{\expandafter\run@hv@extern@cleanup@i#1,\@nil} +\def\run@hv@extern@cleanup@i#1,#2\@nil{% + \def\hv@next{}% + \ifx\relax#1\relax + \else + \hv@typeout{>>>> Delete file \hv@extern@ExamplesDir\hvExternDateiname.#1}% + \ShellEscape{\hv@rm \hv@extern@ExamplesDir\hvExternDateiname.#1}% + \ifx\relax#2\relax\else + \def\hv@next{\run@hv@extern@cleanup@i#2,\@nil}% + \fi + \fi + \hv@next +} + + +\lstset{belowskip=0pt,aboveskip=0pt}% global +\tcbset{breakable,left=2pt,right=2pt,top=2pt,bottom=2pt,boxsep=0pt} + +\newcommand\PreambleVerbatim[2][]{\begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}} + +\newcommand\BodyVerbatim[2][]{\begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}} + +\newcommand\PreambleListing[2][]{\begin{tcolorbox}\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}} + +\newcommand\BodyListing[2][]{\begin{tcolorbox}\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}} + +\newcounter{hv@example@counter} + +\newcommand\extern@ExampleType[5]{% + \@namedef{#1@initTextFancy}{\edef\FancyVerbStartString{#2}\edef\FancyVerbStopString{#3}}% text + \@namedef{#1@initPreambleFancy}{\edef\FancyVerbStartString{#4}\edef\FancyVerbStopString{#5}}% code + \@namedef{#1@initText}{linerange={#2}-{#3},includerangemarker=false}% text + \@namedef{#1@initPreamble}{linerange={#4}-{#5},includerangemarker=false}% code +}% ^^to prevent problems with lua comments + +\input{hvextern-mp.cfg} +\input{hvextern-tex.cfg} +\input{hvextern-latex.cfg} +\input{hvextern-context.cfg} +\input{hvextern-py.cfg} +\input{hvextern-pl.cfg} +\input{hvextern-lua.cfg} + +%% +%% [#1]: Optionen #2: Dateiname +%% +\newenvironment{ErstelleGrafik}[2][]{% + \xdef\hvExternDateiname{#2-\arabic{hv@example@counter}}% + \setkeys{hv}{#1}% \begin + \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.pdf}{}{% + \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.png}{}{% + \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.txt}{}{% + \global\hv@extern@forcetrue}}}% set force, if no pdf or png exists + \begingroup + \hv@typeout{>>> writing file \hvExternDateiname\hv@extern@ext ...}% + \filecontents[force,noheader]{\hvExternDateiname\hv@extern@ext} + } + {\endfilecontents% \end + \hv@typeout{>>> ... done}% + \global\stepcounter{hv@example@counter}% + \endgroup + \ifhv@extern@force + \hv@typeout{>>> force=true: running \hv@extern@progpath\hv@extern@compiler~ \hvExternDateiname\hv@extern@ext ...}% + \setcounter{@@@runs}{\value{hv@extern@runs}}% + \loop\ifnum\the@@@runs > 0\relax + \ifcase\hv@extern@compilerNo \relax % we have metapost + \hv@typeout{>>>> running mpost \hvExternDateiname\hv@extern@ext}% + \hv@extern@runMP{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \or %1 + \hv@typeout{>>>> running tex \hvExternDateiname\hv@extern@ext}% + \hv@extern@runTEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \or %2 + \hv@typeout{>>>> running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% + \hv@extern@runLATEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \else + \hv@typeout{>>>> running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext}% + \fi + \addtocounter{@@@runs}{-1}% + \repeat + \hv@typeout{>>> ... done}% + \ifhv@extern@biber + \ShellEscape{biber \hvExternDateiname}% NAch biber nochmal latex + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname}% + \fi + \ifhv@extern@xindex + \ShellEscape{xindex \hv@extern@xindexOptions\space \hvExternDateiname.idx}% NAch xindex nochmal latex + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname}% + \fi + \ifhv@extern@crop + \ShellEscape{pdfcrop --margins \hv@extern@cropmargin \hvExternDateiname}% + \ShellEscape{\hv@move \hvExternDateiname-crop.pdf \hvExternDateiname.pdf}% + \fi + \ifhv@extern@eps + \ShellEscape{pdftops -eps -f 1 -l 1 \hvExternDateiname.pdf}% + \fi + \fi + \ifhv@extern@code%-------------- Code Part + \par\noindent + \begingroup + \ifdim\hv@extern@mpwidth>\z@ \minipage[t]{\hv@extern@mpwidth}\vspace{0pt}\fi + \ifhv@extern@usefancyvrb + \@nameuse{\hv@extern@docType @initPreambleFancy}% + \edef\@@@temp{\@nameuse{\hv@extern@docType @initPreamble}}% + % we need lstinputlisting, because \VerbatimInput doesn't work in a box + \savebox\hv@extern@box{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternDateiname\hv@extern@ext}}% +% \savebox\hv@extern@box{\VerbatimInput{\hvExternDateiname\hv@extern@ext}}% + \ifdim\wd\hv@extern@box > \z@ + \expandafter\fvset\expandafter{\hv@extern@lstOptions}% + \tcbset{colback=\hv@extern@BGpreamble,colframe=\hv@extern@BOpreamble}% + \PreambleVerbatim{\hvExternDateiname\hv@extern@ext}% + \fi + \else + \edef\@@@temp{\@nameuse{\hv@extern@docType @initPreamble}}% + \savebox\hv@extern@box{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternDateiname\hv@extern@ext}}% + \ifdim\wd\hv@extern@box>\z@ + \expandafter\lstset\expandafter{\hv@extern@lstOptions}% + \tcbset{colback=\hv@extern@BGpreamble,colframe=\hv@extern@BOpreamble}% + \PreambleListing[\@@@temp]{\hvExternDateiname\hv@extern@ext}% + \fi + \fi + \ifhv@extern@showFilename + \marginnote{\rotatebox{90}{\hvExternDateiname\hv@extern@ext}}%[-15mm]% + \fi +% + \ifhv@extern@usefancyvrb + \@nameuse{\hv@extern@docType @initTextFancy}% + \expandafter\fvset\expandafter{\hv@extern@lstOptions}% + \tcbset{colback=\hv@extern@BGbody,colframe=\hv@extern@BObody}% + \expandafter\BodyVerbatim\expandafter[\hv@extern@lstOptions]{\hvExternDateiname\hv@extern@ext}% + \else + \expandafter\lstset\expandafter{\hv@extern@lstOptions}% + \edef\@@@temp{\@nameuse{\hv@extern@docType @initText}}% + \tcbset{colback=\hv@extern@BGbody,colframe=\hv@extern@BObody}% + \BodyListing[\@@@temp]{\hvExternDateiname\hv@extern@ext}% + \fi + \ifdim\hv@extern@mpwidth > \z@\relax \endminipage\fi + \endgroup + \fi + \ifhv@extern@code\else + \ifhv@extern@showFilename + \marginnote{\rotatebox{90}{\hvExternDateiname}}% + \fi + \fi + \ifhv@extern@moveToExampleDir +% \ShellEscape{mkdir\space\hv@extern@ExamplesDir/}% + \ShellEscape{\hv@move \hvExternDateiname.*\space \hv@extern@ExamplesDir}% + \fi + \ifhv@extern@includegraphic + \ifhv@extern@inline + \expandafter\includegraphics\expandafter[\hv@extern@grfOptions]{\hv@extern@ExamplesDir\hvExternDateiname}% + \else + \ifhv@extern@float + \begin{figure}[!htb] + \else + \ifdim\hv@extern@mpwidth>\z@ + \hfill\minipage[t]{\dimexpr\linewidth-\hv@extern@mpwidth-1em\relax}\vspace{0pt}% + \else + \par\noindent\begingroup + \fi + \fi + \hv@extern@align + \ifhv@extern@frame + \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv@extern@pages\do{% + \fbox{\expandafter\includegraphics\expandafter[\hv@extern@grfOptions,page=\next]{\hv@extern@ExamplesDir\hvExternDateiname}}% + \hspace{5pt}}\hspace*{-5pt}% + \else + \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv@extern@pages\do{% + \expandafter\includegraphics\expandafter[\hv@extern@grfOptions,page=\next]{\hv@extern@ExamplesDir\hvExternDateiname}% + \hspace{5pt}}\hspace*{-5pt}% + \fi + \ifx\hv@extern@caption\@empty\else\caption{\hv@extern@caption}\fi + \ifx\hv@extern@label\@empty\else\label{\hv@extern@label}\fi + \ifhv@extern@float + \end{figure}% + \else + \ifdim\hv@extern@mpwidth>\z@ \endminipage\else\par\endgroup\fi + \fi + \fi + \else% no graphic, only text + \ifdim\hv@extern@mpwidth>\z@ + \hfill\minipage[t]{\dimexpr\linewidth-\hv@extern@mpwidth-1em\relax}\vspace{0pt} + \noindent\VerbatimInput{\hv@extern@ExamplesDir\hvExternDateiname.txt} + \endminipage + \else + \noindent\VerbatimInput{\hv@extern@ExamplesDir\hvExternDateiname.txt} + \fi + \fi + \ifhv@extern@force\run@hv@extern@cleanup{\hv@extern@cleanup}\fi% cleanup +} +\stepcounter{hv@example@counter}% +% +\let\externalDocument\ErstelleGrafik +\let\endexternalDocument\endErstelleGrafik +%% +\endinput |