diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/hvextern/Changes | 3 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/hvextern/hvextern.pdf | bin | 1503356 -> 1478943 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/hvextern/hvextern.tex | 35 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/hvextern/hvextern.sty | 232 |
4 files changed, 143 insertions, 127 deletions
diff --git a/Master/texmf-dist/doc/latex/hvextern/Changes b/Master/texmf-dist/doc/latex/hvextern/Changes index 6e6ba9f53fc..5c38357d6f7 100644 --- a/Master/texmf-dist/doc/latex/hvextern/Changes +++ b/Master/texmf-dist/doc/latex/hvextern/Changes @@ -1,11 +1,12 @@ hvextern.sty ---------------- +v 0.36 2023-08-24 - added option "vshift" for inline objects v 0.35 2023-08-22 - fix shellesc option, don`t set it globally to true v 0.34 2023-07-05 - fix for missing --shell-escape option v 0.33 2023-01-29 - fixed bug with vertical space before and end of the example code v 0.32 2022-06-23 - fixed introduced bug - - added checkCode also for pdflatex and xelatex + - added checkCode also for pdflatex and xelatex v 0.31 2022-06-20 - added package option checkCode to run the external file only if the code changes. v 0.30 2022-06-09 - added \hfuzz=\maxdimen for filename to prevent diff --git a/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf b/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf Binary files differindex e6743fb28bc..fddd186b012 100644 --- a/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf +++ b/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf diff --git a/Master/texmf-dist/doc/latex/hvextern/hvextern.tex b/Master/texmf-dist/doc/latex/hvextern/hvextern.tex index b05f01e14a5..84b2df5183e 100644 --- a/Master/texmf-dist/doc/latex/hvextern/hvextern.tex +++ b/Master/texmf-dist/doc/latex/hvextern/hvextern.tex @@ -1,7 +1,7 @@ -%% $Id: hvextern.tex 748 2023-08-22 18:03:42Z herbert $ +%% $Id: hvextern.tex 749 2023-08-24 19:10:17Z herbert $ \RequirePackage{pdfmanagement-testphase} \DeclareDocumentMetadata{} -\documentclass[ngerman,a4paper,twoside]{article} +\documentclass[english,a4paper,twoside]{article} \usepackage{babel} \usepackage{libertinus} \setmonofont[Scale=MatchLowercase,FakeStretch=0.88]{AnonymousPro} @@ -10,13 +10,12 @@ \usepackage{fancyhdr} \pagestyle{fancy} \usepackage{hvlogos} -\usepackage%[checkCode] -{hvextern} +\usepackage[checkCode]{hvextern} \usepackage{hvindex} \usepackage{hvdoctools} \usepackage{listings} \lstset{basicstyle=\ttfamily\small,language=[LaTeX]TeX,breaklines} -\usepackage{xcolor,xspace} +\usepackage{xcolor,xspace,varioref} \usepackage{hyperref} \def\Python{\textsf{Python}\xspace} @@ -28,14 +27,14 @@ \begin{document} \title{Writing, running and including the output of external documents from within a main\newline \LaTeX\ document~--v. \hvexternFileversion} -\author{Herbert Voß \url{herbert@dante.de}\thanks{Thanks to Karl Berry; +\author{Herbert Voß \url{hvoss@tug.org}\thanks{Thanks to Karl Berry; Werner Lemberg; Rolf Niepraschk}} \maketitle \tableofcontents %\newpage -\setkeys{hv}{%moveToExampleDir,ExampleDir=Exa, +\setkeys{hv}{moveToExampleDir,ExampleDir=Exa, showFilename,verbose} @@ -78,7 +77,12 @@ source code {<external filename without extension>} \end{verbatim} -The main document \emph{must} be run with the \Loption{-shell-escape} option, otherwise it won't work, e.g.: +The very first compilation run of the main document must be done + with the \Loption{-shell-escape} command-line option, otherwise it won't + work. Follow-up runs, for example, to resolve references, should + usually be done without \Loption{-shell-escape}. + +The currently used filename for the example is saved in the macro \Lcs{hvExternFilename}. \begin{verbatim} lualatex --shell-escape <file> @@ -107,10 +111,10 @@ This document was run with \LuaLaTeX. Suppose you want to insert the output of a which needs for several reasons a \XeLaTeX\ 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 \XeLaTeX\ and the output is insert as pdf image: +with \XeLaTeX\ and the output is insert as pdf image:\label{inline-exa} \begin{externalDocument}[% compiler=xelatex, inline, force=true, runs=2, grfOptions={height=8pt},% - crop, cropmargin=0, cleanup, docType=latex]{voss} + crop, cropmargin=0, cleanup, docType=latex,vshift=-1pt]{voss} \documentclass{ctexart} \pagestyle{empty} \begin{document} @@ -118,7 +122,9 @@ with \XeLaTeX\ and the output is insert as pdf image: \end{document} \end{externalDocument} -Another example which needs a \pdfLaTeX\ run. The \Index{source} code itself is also not +The current filename of the above example is \hvExternFilename. + +Let's show another example which needs a \pdfLaTeX\ run. The \Index{source} code itself is also not shown by the environment \Lenv{externalDocument}. @@ -1867,8 +1873,8 @@ to get the directory listed: \section{Other options} \begin{description} -%\item[\Lkeyword{showFilename}] Prints the filename in the outer margin (right for oneside) or in twocolumn mode for -% the first column in the left and the second column in the right margin. +\item[\Lkeyword{vshift}] A length for a vertical shift of the object, only valid for the inline mode. +See document source of example~\vpageref{inline-exa}. %\item[\Lkeyword{outerFN}] Only valid for the twocolumn mode with onecolumn floats (environment \texttt{figure*}), % to get the filename on the right or left of the whole page. %\item[\Lkeyword{shiftFN}] A length to move the printed filename up or down. @@ -1889,6 +1895,9 @@ if the package option \Loption{checkCode} exists. \end{description} + + + \printindex diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern.sty b/Master/texmf-dist/tex/latex/hvextern/hvextern.sty index b61d69a6fab..1304e197e74 100644 --- a/Master/texmf-dist/tex/latex/hvextern/hvextern.sty +++ b/Master/texmf-dist/tex/latex/hvextern/hvextern.sty @@ -1,4 +1,4 @@ -%% $Id: hvextern.sty 747 2023-08-22 17:53:38Z herbert $ +%% $Id: hvextern.sty 749 2023-08-24 19:10:17Z herbert $ %% This is file `hvextern.sty', %% %% Copyright (C) 2016-23 @@ -12,8 +12,8 @@ %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. -\def\hvexternFileversion{0.35} -\ProvidesFile{hvextern}[2023/08/22 v\hvexternFileversion: package for running external documents (HV)] +\def\hvexternFileversion{0.36} +\ProvidesFile{hvextern}[2023/08/24 v\hvexternFileversion: package for running external documents (HV)] \newif\ifhv@extern@checkCode \hv@extern@checkCodefalse @@ -36,7 +36,6 @@ \def\hv@mkdir{mkdir }% \else \def\hv@move{mv }% - \def\hv@move{mv }% \def\hv@rm{rm }% \def\hv@mkdir{mkdir -p }% \def\hv@diff{diff } @@ -56,6 +55,7 @@ \newlength\hv@extern@belowbodyskip \newlength\hv@extern@belowskip \newlength\hv@extern@shiftFN +\newlength\hv@extern@vshift \newlength\hvExternLineWidth \AtBeginDocument{\hvExternLineWidth=\the\dimexpr\linewidth-2\fboxsep-2\fboxrule\relax} @@ -94,6 +94,7 @@ \define@boolkey{hv}[hv@extern@]{showFilename}[true]{} \define@boolkey{hv}[hv@extern@]{outerFN}[true]{} \define@key{hv}{shiftFN}[0pt]{\setlength\hv@extern@shiftFN{#1}} +\define@key{hv}{vshift}[0pt]{\setlength\hv@extern@vshift{#1}}% \define@boolkey{hv}[hv@extern@]{code}[true]{} \define@boolkey{hv}[hv@extern@]{force}[true]{} \define@boolkey{hv}[hv@extern@]{crop}[true]{} @@ -140,9 +141,10 @@ \def\ResetKeys{% \setkeys{hv}{% - showFilename=false,% Dateinamen im Rand angeben + showFilename=false,% Filenamen im Rand angeben outerFN=false,% use fullwidth in twocolumn mode (starred floats) shiftFN=\z@,% raise printed filename + vshift=\z@,% raise object (pdf) with \raisebox{}{} ext=tex,% file extension code=false,% show Code crop=false,% erzeugte PDF "croppen" @@ -219,7 +221,7 @@ \ExplSyntaxOn \NewDocumentCommand\run@hv@extern@cleanup{ m } { - \clist_map_inline:nn {#1}{\ShellEscape{\hv@rm \hv@extern@ExamplesDir\hvExternDateiname.##1}} + \clist_map_inline:nn {#1}{\ShellEscape{\hv@rm \hv@extern@ExamplesDir\hvExternFilename.##1}} \ifnum\hv@extern@compilerNo=0\relax % we have metapost \ShellEscape{\hv@rm\space epsf.*}% \fi @@ -228,7 +230,7 @@ { \clist_map_inline:nn {#1}{% \hv@ex@typeout{sequencerun: ##1}% - \ShellEscape{\hv@extern@progpath##1\space\hv@run@options\hvExternDateiname}% + \ShellEscape{\hv@extern@progpath##1\space\hv@run@options\hvExternFilename}% } } \ExplSyntaxOff @@ -428,42 +430,42 @@ %%%--------------------------------- end config part ------------------ %% -%% [#1]: Optionen #2: Dateiname +%% [#1]: Optionen #2: Filename %% \newenvironment{externalDocument}[2][] {% \ifhv@extern@shellesc\gdef\hv@run@options{ --shell-escape }\else\gdef\hv@run@options{}\fi% - \xdef\hvExternDateiname{#2-\arabic{hv@example@counter}}% + \xdef\hvExternFilename{#2-\arabic{hv@example@counter}}% \gdef\hv@extern@savePara{#1}% \setkeys{hv}{#1}% \begin - \hv@ex@typeout{External filename: \hvExternDateiname}% - \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.pdf}{}{% - \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.png}{}{% - \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.txt}{}{% + \hv@ex@typeout{External filename: \hvExternFilename}% + \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternFilename.pdf}{}{% + \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternFilename.png}{}{% + \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternFilename.txt}{}{% \global\hv@extern@forcetrue}}}% set force, if no pdf or png exists \begingroup - \hv@ex@typeout{writing file \hvExternDateiname\hv@extern@ext ...}% - \filecontents[force,noheader]{\hvExternDateiname\hv@extern@ext}% + \hv@ex@typeout{writing file \hvExternFilename\hv@extern@ext ...}% + \filecontents[force,noheader]{\hvExternFilename\hv@extern@ext}% } {\endfilecontents% \end% \hv@ex@typeout{... done}% \global\stepcounter{hv@example@counter}% \endgroup \expandafter\hvExternSetKeys\expandafter{\hv@extern@savePara}% - \xdef\hv@extern@fullPath{\hv@extern@ExamplesDir\hvExternDateiname}% + \xdef\hv@extern@fullPath{\hv@extern@ExamplesDir\hvExternFilename}% \ifhv@extern@checkCode \ifluatex - \directlua{if GetFileContents("\hvExternDateiname\hv@extern@ext", - "\hv@extern@ExamplesDir\hvExternDateiname\hv@extern@ext") then + \directlua{if GetFileContents("\hvExternFilename\hv@extern@ext", + "\hv@extern@ExamplesDir\hvExternFilename\hv@extern@ext") then tex.print("\\csname hv@ex@typeout\\endcsname{current file is NOT newer: no run }\\global\\csname hv@extern@forcefalse\\endcsname") else tex.print("\\csname hv@ex@typeout\\endcsname{current file is newer: force run }\\global\\csname hv@extern@forcetrue\\endcsname") end}% \else \hv@ex@typeout{Check, if new file has a different code}% - \ShellEscape{hvextern-checkfile "\hvExternDateiname\hv@extern@ext" - "\hv@extern@ExamplesDir\hvExternDateiname\hv@extern@ext"}% - \InputIfFileExists{\hvExternDateiname\hv@extern@ext.diff}{}{}% + \ShellEscape{hvextern-checkfile "\hvExternFilename\hv@extern@ext" + "\hv@extern@ExamplesDir\hvExternFilename\hv@extern@ext"}% + \InputIfFileExists{\hvExternFilename\hv@extern@ext.diff}{}{}% \ifx\hvCheckNewFile\empty \hv@ex@typeout{current file is NOT newer: no run }% \global\hv@extern@forcefalse @@ -471,63 +473,63 @@ \hv@ex@typeout{current file is newer: force run }% \global\hv@extern@forcetrue \fi - \ifhv@extern@verbose\else\ShellEscape{\hv@rm \hvExternDateiname\hv@extern@ext.diff}\fi + \ifhv@extern@verbose\else\ShellEscape{\hv@rm \hvExternFilename\hv@extern@ext.diff}\fi \fi \fi \ifhv@extern@force \ifx\hv@extern@runsequence\@empty - \hv@ex@typeout{force=true: running \hv@extern@progpath\hv@extern@compiler\ \hv@run@options \hvExternDateiname\hv@extern@ext ...}% + \hv@ex@typeout{force=true: running \hv@extern@progpath\hv@extern@compiler\ \hv@run@options \hvExternFilename\hv@extern@ext ...}% \setcounter{@@@runs}{\value{hv@extern@runs}}% \loop\ifnum\the@@@runs > 0\relax \ifcase\hv@extern@compilerNo \relax % we have metapost - \hv@ex@typeout{running mpost \hvExternDateiname\hv@extern@ext}% - \hv@extern@runMP{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \hv@ex@typeout{running mpost \hvExternFilename\hv@extern@ext}% + \hv@extern@runMP{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternFilename}{\hv@extern@ext}% \or %1 - \hv@ex@typeout{running tex \hvExternDateiname\hv@extern@ext}% - \hv@extern@runTEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \hv@ex@typeout{running tex \hvExternFilename\hv@extern@ext}% + \hv@extern@runTEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternFilename}{\hv@extern@ext}% \or %2 - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% - \hv@extern@runLATEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext}% + \hv@extern@runLATEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternFilename}{\hv@extern@ext}% \else \ifhv@extern@redirect - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext > \hvExternDateiname.txt}% - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext\space > \hvExternDateiname.txt}% + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext > \hvExternFilename.txt}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename\hv@extern@ext\space > \hvExternFilename.txt}% \else - \hv@ex@typeout{running \hv@extern@compiler~\hv@run@options~\hvExternDateiname\hv@extern@ext}% - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hv@run@options\space\hvExternDateiname\hv@extern@ext}% + \hv@ex@typeout{running \hv@extern@compiler~\hv@run@options~\hvExternFilename\hv@extern@ext}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hv@run@options\space\hvExternFilename\hv@extern@ext}% \fi \fi \addtocounter{@@@runs}{-1}% \repeat \hv@ex@typeout{... done}% \ifhv@extern@biber - \ShellEscape{biber \hvExternDateiname}% NAch biber nochmal latex - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname}% + \ShellEscape{biber \hvExternFilename}% NAch biber nochmal latex + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename}% \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}% + \ShellEscape{xindex \hv@extern@xindexOptions\space \hvExternFilename.idx}% NAch xindex nochmal latex + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename}% \fi \expandafter\ifnum\value{hv@extern@runsAfter} > 0 - \hv@ex@typeout{runsAfter>0: running \hv@extern@progpath\hv@extern@compiler~ \hvExternDateiname\hv@extern@ext ...}% + \hv@ex@typeout{runsAfter>0: running \hv@extern@progpath\hv@extern@compiler~ \hvExternFilename\hv@extern@ext ...}% \setcounter{@@@runs}{\value{hv@extern@runsAfter}}% \loop\ifnum\the@@@runs > 0\relax \ifcase\hv@extern@compilerNo \relax % we have metapost - \hv@ex@typeout{running mpost \hvExternDateiname\hv@extern@ext}% - \hv@extern@runMP{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \hv@ex@typeout{running mpost \hvExternFilename\hv@extern@ext}% + \hv@extern@runMP{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternFilename}{\hv@extern@ext}% \or %1 - \hv@ex@typeout{running tex \hvExternDateiname\hv@extern@ext}% - \hv@extern@runTEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \hv@ex@typeout{running tex \hvExternFilename\hv@extern@ext}% + \hv@extern@runTEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternFilename}{\hv@extern@ext}% \or %2 - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% - \hv@extern@runLATEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext}% + \hv@extern@runLATEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternFilename}{\hv@extern@ext}% \else \ifhv@extern@redirect - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext > \hvExternDateiname.txt}% - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext\space > \hvExternDateiname.txt}% + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext > \hvExternFilename.txt}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename\hv@extern@ext\space > \hvExternFilename.txt}% \else - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext}% + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename\hv@extern@ext}% \fi \fi \addtocounter{@@@runs}{-1}% @@ -538,14 +540,14 @@ \expandafter\run@hv@extern@sequenceList\expandafter{\hv@extern@runsequence}% \fi \ifhv@extern@crop - \ShellEscape{pdfcrop --margins \hv@extern@cropmargin \hvExternDateiname}% - \ShellEscape{\hv@move \hvExternDateiname-crop.pdf \hvExternDateiname.pdf}% + \ShellEscape{pdfcrop --margins \hv@extern@cropmargin \hvExternFilename}% + \ShellEscape{\hv@move \hvExternFilename-crop.pdf \hvExternFilename.pdf}% \fi \ifhv@extern@eps - \ShellEscape{pdftops -eps -f 1 -l 1 \hvExternDateiname.pdf}% + \ShellEscape{pdftops -eps -f 1 -l 1 \hvExternFilename.pdf}% \fi \else - \hv@ex@typeout{force=false: NOT running \hvExternDateiname\hv@extern@ext ...}% + \hv@ex@typeout{force=false: NOT running \hvExternFilename\hv@extern@ext ...}% \fi% end force \hfuzz=\maxdimen \ifhv@extern@code%-------------- Code Part @@ -573,20 +575,20 @@ \@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{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternFilename\hv@extern@ext}}% \ifdim\wd\hv@extern@box > \z@\relax \expandafter\fvset\expandafter{\hv@extern@lstOptions}% \tcbset{colback=\hv@extern@BGpreamble,colframe=\hv@extern@BOpreamble}% - \PreambleVerbatim{\hvExternDateiname\hv@extern@ext}% + \PreambleVerbatim{\hvExternFilename\hv@extern@ext}% \vspace{\hv@extern@belowpreambleskip}% \fi \else \edef\@@@temp{\@nameuse{\hv@extern@docType @initPreamble}}% - \savebox\hv@extern@box{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternDateiname\hv@extern@ext}}% + \savebox\hv@extern@box{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternFilename\hv@extern@ext}}% \ifdim\wd\hv@extern@box>\z@\relax \expandafter\lstset\expandafter{\hv@extern@lstOptions}% \tcbset{colback=\hv@extern@BGpreamble,colframe=\hv@extern@BOpreamble}% - \PreambleListing[\@@@temp]{\hvExternDateiname\hv@extern@ext}% + \PreambleListing[\@@@temp]{\hvExternFilename\hv@extern@ext}% \vspace{\hv@extern@belowpreambleskip}% \fi \fi @@ -594,7 +596,7 @@ \hv@ex@typeout{Set filename in the margin!}% \noindent \hfuzz=\maxdimen - \hv@marginpar{\hvExternDateiname\hv@extern@ext}% + \hv@marginpar{\hvExternFilename\hv@extern@ext}% \fi % \hv@ex@typeout{Starting Code body ...}%} @@ -602,12 +604,12 @@ \@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}% + \expandafter\BodyVerbatim\expandafter[\hv@extern@lstOptions]{\hvExternFilename\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}% + \BodyListing[\@@@temp]{\hvExternFilename\hv@extern@ext}% \fi \ifdim\hv@extern@mpwidth > \z@\relax \endminipage\fi \endgroup @@ -616,19 +618,20 @@ \ifhv@extern@showFilename \hv@ex@typeout{Set filename in the margin!}% \noindent - \hv@marginpar{\hvExternDateiname\hv@extern@ext}% + \hv@marginpar{\hvExternFilename\hv@extern@ext}% \fi \fi \ifhv@extern@moveToExampleDir % \ShellEscape{mkdir\space\hv@extern@ExamplesDir/}% \hv@ex@typeout{Move file into example dir}% - \hv@ex@typeout{\hvExternDateiname ----> \hv@extern@ExamplesDir}% - \ShellEscape{\hv@move \hvExternDateiname.*\space \hv@extern@ExamplesDir}% + \hv@ex@typeout{\hvExternFilename ----> \hv@extern@ExamplesDir}% + \ShellEscape{\hv@move \hvExternFilename.*\space \hv@extern@ExamplesDir}% \fi \ifhv@extern@showoutput \ifhv@extern@includegraphic \ifhv@extern@inline - \expandafter\includegraphics\expandafter[\hv@extern@grfOptions]{\hv@extern@fullPath}% + \raisebox{\hv@extern@vshift}{% + \expandafter\includegraphics\expandafter[\hv@extern@grfOptions]{\hv@extern@fullPath}}% \else \ifhv@extern@float \hv@ex@typeout{Floating environment}% @@ -687,19 +690,22 @@ \fi \fi \fi - \fi% end of \ifshowoutput - \ifhv@extern@force\expandafter\run@hv@extern@cleanup\expandafter{\hv@extern@cleanup}\fi% cleanup + \fi% end of \ifshowoutput + \ifhv@extern@force\expandafter\run@hv@extern@cleanup\expandafter{\hv@extern@cleanup}\fi% cleanup + \hv@ex@typeout{Move source file into example dir, in case of missing --shell-escape}% +% \hv@ex@typeout{\hvExternFilename ----> \hv@extern@ExamplesDir}% + \ShellEscape{\hv@move \hvExternFilename\hv@extern@ext\space \hv@extern@ExamplesDir}% \vspace{\hv@extern@belowskip}% } \newcommand\runExtCmd[3][]{% #1:options; #2:comamnd; #3:filename \begingroup \setkeys{hv}{cleanup={},code=false,includegraphic=false,#1}% - \xdef\hvExternDateiname{#3-\arabic{hv@example@counter}}% - \xdef\hv@extern@fullPath{\hv@extern@ExamplesDir\hvExternDateiname}% + \xdef\hvExternFilename{#3-\arabic{hv@example@counter}}% + \xdef\hv@extern@fullPath{\hv@extern@ExamplesDir\hvExternFilename}% \hv@ex@typeout{running #2}% \ifhv@extern@redirect - \ShellEscape{\hv@extern@progpath#2 > \hv@extern@ExamplesDir\hvExternDateiname.txt}% + \ShellEscape{\hv@extern@progpath#2 > \hv@extern@ExamplesDir\hvExternFilename.txt}% \else \ShellEscape{\hv@extern@progpath#2}% \fi @@ -708,7 +714,7 @@ \ifhv@extern@showoutput \ifhv@extern@includegraphic \ifhv@extern@inline - \expandafter\includegraphics\expandafter[\hv@extern@grfOptions]{\hv@extern@ExamplesDir\hvExternDateiname}% + \expandafter\includegraphics\expandafter[\hv@extern@grfOptions]{\hv@extern@ExamplesDir\hvExternFilename}% \else \ifhv@extern@float \hv@ex@typeout{Floating environment}% @@ -718,7 +724,7 @@ \par\noindent\begingroup \fi \hv@extern@align - \hv@ex@typeout{Input image \hv@extern@ExamplesDir\hvExternDateiname}% + \hv@ex@typeout{Input image \hv@extern@ExamplesDir\hvExternFilename}% \ifhv@extern@frame \begingroup \fboxsep=\hv@extern@framesep @@ -864,37 +870,37 @@ \newenvironment{createPNGfromPSTricks}[3][]% #1:options #2: pstricks packages #3: filename {% - \xdef\hvExternDateiname{#2-\arabic{hv@example@counter}}% + \xdef\hvExternFilename{#2-\arabic{hv@example@counter}}% \gdef\hv@extern@savePara{#1}% \setkeys{hv}{#1}% \begin - \hv@ex@typeout{External filename: \hvExternDateiname}% - \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.pdf}{}{% - \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.png}{}{% - \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.txt}{}{% + \hv@ex@typeout{External filename: \hvExternFilename}% + \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternFilename.pdf}{}{% + \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternFilename.png}{}{% + \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternFilename.txt}{}{% \global\hv@extern@forcetrue}}}% set force, if no pdf or png exists \begingroup - \hv@ex@typeout{writing file \hvExternDateiname\hv@extern@ext ...}% - \filecontents[force,noheader]{\hvExternDateiname\hv@extern@ext}% + \hv@ex@typeout{writing file \hvExternFilename\hv@extern@ext ...}% + \filecontents[force,noheader]{\hvExternFilename\hv@extern@ext}% } {\endfilecontents% \end% \hv@ex@typeout{... done}% \global\stepcounter{hv@example@counter}% \endgroup \expandafter\hvExternSetKeys\expandafter{\hv@extern@savePara}% - \xdef\hv@extern@fullPath{\hv@extern@ExamplesDir\hvExternDateiname}% + \xdef\hv@extern@fullPath{\hv@extern@ExamplesDir\hvExternFilename}% \ifhv@extern@checkCode \ifluatex - \directlua{if GetFileContents("\hvExternDateiname\hv@extern@ext", - "\hv@extern@ExamplesDir\hvExternDateiname\hv@extern@ext") then + \directlua{if GetFileContents("\hvExternFilename\hv@extern@ext", + "\hv@extern@ExamplesDir\hvExternFilename\hv@extern@ext") then tex.print("\\csname hv@ex@typeout\\endcsname{current file is NOT newer: no run }\\global\\csname hv@extern@forcefalse\\endcsname") else tex.print("\\csname hv@ex@typeout\\endcsname{current file is newer: force run }\\global\\csname hv@extern@forcetrue\\endcsname") end}% \else \hv@ex@typeout{Check, if new file has a different code}% - \ShellEscape{hvextern-checkfile "\hvExternDateiname\hv@extern@ext" - "\hv@extern@ExamplesDir\hvExternDateiname\hv@extern@ext"}% - \InputIfFileExists{\hvExternDateiname\hv@extern@ext.diff}{}{}% + \ShellEscape{hvextern-checkfile "\hvExternFilename\hv@extern@ext" + "\hv@extern@ExamplesDir\hvExternFilename\hv@extern@ext"}% + \InputIfFileExists{\hvExternFilename\hv@extern@ext.diff}{}{}% \ifx\hvCheckNewFile\empty \hv@ex@typeout{current file is NOT newer: no run }% \global\hv@extern@forcefalse @@ -902,55 +908,55 @@ \hv@ex@typeout{current file is newer: force run }% \global\hv@extern@forcetrue \fi - \ifhv@extern@verbose\else\hv@rm{\hvExternDateiname\hv@extern@ext.diff}\fi + \ifhv@extern@verbose\else\hv@rm{\hvExternFilename\hv@extern@ext.diff}\fi \fi \fi \ifhv@extern@force \ifx\hv@extern@runsequence\@empty - \hv@ex@typeout{force=true: running \hv@extern@progpath\hv@extern@compiler~ \hvExternDateiname\hv@extern@ext ...}% + \hv@ex@typeout{force=true: running \hv@extern@progpath\hv@extern@compiler~ \hvExternFilename\hv@extern@ext ...}% \setcounter{@@@runs}{\value{hv@extern@runs}}% \loop\ifnum\the@@@runs > 0\relax \ifcase\hv@extern@compilerNo \relax % we have metapost - \hv@ex@typeout{running mpost \hvExternDateiname\hv@extern@ext}% - \hv@extern@runMP{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \hv@ex@typeout{running mpost \hvExternFilename\hv@extern@ext}% + \hv@extern@runMP{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternFilename}{\hv@extern@ext}% \or %1 - \hv@ex@typeout{running tex \hvExternDateiname\hv@extern@ext}% - \hv@extern@runTEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \hv@ex@typeout{running tex \hvExternFilename\hv@extern@ext}% + \hv@extern@runTEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternFilename}{\hv@extern@ext}% \or %2 - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% - \hv@extern@runLATEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext}% + \hv@extern@runLATEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternFilename}{\hv@extern@ext}% \else \ifhv@extern@redirect - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext > \hvExternDateiname.txt}% - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext\space > \hvExternDateiname.txt}% + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext > \hvExternFilename.txt}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename\hv@extern@ext\space > \hvExternFilename.txt}% \else - \hv@ex@typeout{running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext}% + \hv@ex@typeout{running \hv@extern@compiler~ \hvExternFilename\hv@extern@ext}% + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename\hv@extern@ext}% \fi \fi \addtocounter{@@@runs}{-1}% \repeat \hv@ex@typeout{... done}% \ifhv@extern@biber - \ShellEscape{biber \hvExternDateiname}% NAch biber nochmal latex - \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname}% + \ShellEscape{biber \hvExternFilename}% NAch biber nochmal latex + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename}% \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}% + \ShellEscape{xindex \hv@extern@xindexOptions\space \hvExternFilename.idx}% NAch xindex nochmal latex + \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternFilename}% \fi \else % runsequence \expandafter\run@hv@extern@sequenceList\expandafter{\hv@extern@runsequence}% \fi \ifhv@extern@crop - \ShellEscape{pdfcrop --margins \hv@extern@cropmargin \hvExternDateiname}% - \ShellEscape{\hv@move \hvExternDateiname-crop.pdf \hvExternDateiname.pdf}% + \ShellEscape{pdfcrop --margins \hv@extern@cropmargin \hvExternFilename}% + \ShellEscape{\hv@move \hvExternFilename-crop.pdf \hvExternFilename.pdf}% \fi \ifhv@extern@eps - \ShellEscape{pdftops -eps -f 1 -l 1 \hvExternDateiname.pdf}% + \ShellEscape{pdftops -eps -f 1 -l 1 \hvExternFilename.pdf}% \fi \else - \hv@ex@typeout{force=false: NOT running \hvExternDateiname\hv@extern@ext ...}% + \hv@ex@typeout{force=false: NOT running \hvExternFilename\hv@extern@ext ...}% \fi% end force \hfuzz=\maxdimen \ifhv@extern@code%-------------- Code Part @@ -977,20 +983,20 @@ \@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{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternFilename\hv@extern@ext}}% \ifdim\wd\hv@extern@box > \z@\relax \expandafter\fvset\expandafter{\hv@extern@lstOptions}% \tcbset{colback=\hv@extern@BGpreamble,colframe=\hv@extern@BOpreamble}% - \PreambleVerbatim{\hvExternDateiname\hv@extern@ext}% + \PreambleVerbatim{\hvExternFilename\hv@extern@ext}% \vspace{\hv@extern@belowpreambleskip}% \fi \else \edef\@@@temp{\@nameuse{\hv@extern@docType @initPreamble}}% - \savebox\hv@extern@box{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternDateiname\hv@extern@ext}}% + \savebox\hv@extern@box{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternFilename\hv@extern@ext}}% \ifdim\wd\hv@extern@box>\z@\relax \expandafter\lstset\expandafter{\hv@extern@lstOptions}% \tcbset{colback=\hv@extern@BGpreamble,colframe=\hv@extern@BOpreamble}% - \PreambleListing[\@@@temp]{\hvExternDateiname\hv@extern@ext}% + \PreambleListing[\@@@temp]{\hvExternFilename\hv@extern@ext}% \vspace{\hv@extern@belowpreambleskip}% \fi \fi @@ -998,7 +1004,7 @@ \hv@ex@typeout{Set filename in the margin!}% \noindent \hfuzz=\maxdimen - \hv@marginpar{\hvExternDateiname\hv@extern@ext}% + \hv@marginpar{\hvExternFilename\hv@extern@ext}% \fi % \hv@ex@typeout{Starting Code body ...}%} @@ -1006,12 +1012,12 @@ \@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}% + \expandafter\BodyVerbatim\expandafter[\hv@extern@lstOptions]{\hvExternFilename\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}% + \BodyListing[\@@@temp]{\hvExternFilename\hv@extern@ext}% \fi \ifdim\hv@extern@mpwidth > \z@\relax \endminipage\fi \endgroup @@ -1020,14 +1026,14 @@ \ifhv@extern@showFilename \hv@ex@typeout{Set filename in the margin!}% \noindent - \hv@marginpar{\hvExternDateiname\hv@extern@ext}% + \hv@marginpar{\hvExternFilename\hv@extern@ext}% \fi \fi \ifhv@extern@moveToExampleDir % \ShellEscape{mkdir\space\hv@extern@ExamplesDir/}% \hv@ex@typeout{Move file into example dir}% - \hv@ex@typeout{\hvExternDateiname ----> \hv@extern@ExamplesDir}% - \ShellEscape{\hv@move \hvExternDateiname.*\space \hv@extern@ExamplesDir}% + \hv@ex@typeout{\hvExternFilename.* ----> \hv@extern@ExamplesDir}% + \ShellEscape{\hv@move \hvExternFilename.*\space \hv@extern@ExamplesDir}% \fi \ifhv@extern@showoutput \ifhv@extern@includegraphic |