diff options
author | Norbert Preining <norbert@preining.info> | 2022-05-06 03:00:50 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-05-06 03:00:50 +0000 |
commit | 3e3ecb7f722d0904c12ee0648c343b865dc99187 (patch) | |
tree | 8c13ed895e7191ed6c6a583a9730bde9cdd2a92f /macros/latex/contrib/hvextern/latex | |
parent | c8185bb3cd55c24b45c9b19c4ea36b8c7057199d (diff) |
CTAN sync 202205060300
Diffstat (limited to 'macros/latex/contrib/hvextern/latex')
-rw-r--r-- | macros/latex/contrib/hvextern/latex/hvextern.sty | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/macros/latex/contrib/hvextern/latex/hvextern.sty b/macros/latex/contrib/hvextern/latex/hvextern.sty index 54a921e0a1..f728f941ae 100644 --- a/macros/latex/contrib/hvextern/latex/hvextern.sty +++ b/macros/latex/contrib/hvextern/latex/hvextern.sty @@ -11,8 +11,8 @@ %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. -\def\hvexternFileversion{0.21} -\ProvidesFile{hvextern}[2022/04/30 v\hvexternFileversion: package for running external documents (HV)] +\def\hvexternFileversion{0.22} +\ProvidesFile{hvextern}[2022/05/05 v\hvexternFileversion: package for running external documents (HV)] \RequirePackage{shellesc,xkeyval,graphicx,marginnote,fancyvrb,tikz,listings,ifplatform} \RequirePackage{tcolorbox,xparse} @@ -48,6 +48,7 @@ \define@key{hv}{pages}[1]{\def\hv@extern@pages{#1}} \define@key{hv}{cropmargin}[2]{\def\hv@extern@cropmargin{#1 }} \define@key{hv}{mpwidth}[0pt]{\setlength\hv@extern@mpwidth{#1}} +\define@key{hv}{mpvalign}[t]{\def\hv@extern@mpvalign{#1}} \define@key{hv}{ext}[tex]{\def\hv@extern@ext{.#1}} \define@boolkey{hv}[hv@extern@]{redirect}[true]{} \define@boolkey{hv}[hv@extern@]{usefancyvrb}[true]{} @@ -55,6 +56,7 @@ \define@boolkey{hv}[hv@extern@]{code}[true]{} \define@boolkey{hv}[hv@extern@]{force}[true]{} \define@boolkey{hv}[hv@extern@]{crop}[true]{} +\define@boolkey{hv}[hv@extern@]{tcbox}[true]{} \define@boolkey{hv}[hv@extern@]{biber}[true]{} \define@boolkey{hv}[hv@extern@]{xindex}[true]{} \define@key{hv}{xindexOptions}[]{\def\hv@extern@xindexOptions{#1}} @@ -96,6 +98,7 @@ crop=false,% erzeugte PDF "croppen" compiler=pdflatex,% zu verwendener Compiler redirect=false,% write output into a file *.txt + tcbox=true,% use tcolorbox grfOptions={},% Optionen der einzubindenden Grafik lstOptions={},% Optionen für das Listing BGpreamble=black!12,% Backgroundcolor for preamble @@ -121,12 +124,14 @@ ExampleDir=Examples,% Unterverzeichnis für Beispiele align=\centering,% Ausgabe zentrieren mpwidth=0pt,% no minipage + mpvalign=t,% if side by side output the vertical alignment usefancyvrb=false,% use VerbatimInput instead of listings progpath={}, cropmargin=2,% 2pb margin eps=false,% create an eps output? - } + }% } + \ResetKeys {\catcode`\%=12 @@ -157,13 +162,33 @@ \lstset{belowskip=0pt,aboveskip=0pt}% global \tcbset{breakable,left=2pt,right=2pt,top=2pt,bottom=2pt,boxsep=0pt} -\newcommand\PreambleVerbatim[2][]{\begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}} +\newcommand\PreambleVerbatim[2][]{% + \ifhv@extern@tcbox + \begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}% + \else + \VerbatimInput[#1]{#2} + \fi} -\newcommand\BodyVerbatim[2][]{\begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}} +\newcommand\BodyVerbatim[2][]{% + \ifhv@extern@tcbox + \begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}% + \else + \VerbatimInput[#1]{#2} + \fi} -\newcommand\PreambleListing[2][]{\begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}} +\newcommand\PreambleListing[2][]{% + \ifhv@extern@tcbox + \begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}% + \else + \expandafter\lstinputlisting\expandafter[#1]{#2}% + \fi} -\newcommand\BodyListing[2][]{\begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}} +\newcommand\BodyListing[2][]{% + \ifhv@extern@tcbox + \begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}% + \else + \expandafter\lstinputlisting\expandafter[#1]{#2}% + \fi} \newcounter{hv@example@counter} @@ -339,7 +364,7 @@ \ifhv@extern@code%-------------- Code Part \par\noindent \begingroup - \ifdim\hv@extern@mpwidth>\z@ \minipage[t]{\hv@extern@mpwidth}\vspace{0pt}\fi + \ifdim\hv@extern@mpwidth>\z@ \minipage[\hv@extern@mpvalign]{\hv@extern@mpwidth}\vspace{0pt}\fi \ifhv@extern@usefancyvrb \@nameuse{\hv@extern@docType @initPreambleFancy}% \edef\@@@temp{\@nameuse{\hv@extern@docType @initPreamble}}% @@ -399,7 +424,7 @@ \else \hv@typeout{>>>> No floating environment}% \ifdim\hv@extern@mpwidth>\z@ - \hfill\minipage[t]{\dimexpr\linewidth-\hv@extern@mpwidth-1em\relax}\vspace{0pt}% + \hfill\minipage[\hv@extern@mpvalign]{\dimexpr\linewidth-\hv@extern@mpwidth-1em\relax}\vspace{0pt}% \else \par\noindent\begingroup \fi |