summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hvextern
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-04-30 20:02:01 +0000
committerKarl Berry <karl@freefriends.org>2022-04-30 20:02:01 +0000
commite1738ea0853a78ce457cffe0611bcee5e2062154 (patch)
tree4805348f0640df095ed3dc2d34c615435becfea7 /Master/texmf-dist/tex/latex/hvextern
parent3121c00515ac99bbd70fef1417dba9803a13dc1b (diff)
hvextern (30apr22)
git-svn-id: svn://tug.org/texlive/trunk@63187 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hvextern')
-rw-r--r--Master/texmf-dist/tex/latex/hvextern/hvextern.sty33
1 files changed, 25 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern.sty b/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
index 9e3fbea8c0e..54a921e0a16 100644
--- a/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
+++ b/Master/texmf-dist/tex/latex/hvextern/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.20}
-\ProvidesFile{hvextern}[2022/04/27 v\hvexternFileversion: package for running external documents (HV)]
+\def\hvexternFileversion{0.21}
+\ProvidesFile{hvextern}[2022/04/30 v\hvexternFileversion: package for running external documents (HV)]
\RequirePackage{shellesc,xkeyval,graphicx,marginnote,fancyvrb,tikz,listings,ifplatform}
\RequirePackage{tcolorbox,xparse}
@@ -78,13 +78,14 @@
\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}%
+\define@choicekey*+{hv}{compiler}[\val\nr]{mpost,tex,latex,luatex,python3,perl,lua,java,%
+ 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\hv@extern@compilerNo{9}%
}
\def\ResetKeys{%
@@ -140,6 +141,9 @@
\NewDocumentCommand\run@hv@extern@cleanup{ m }
{
\clist_map_inline:nn {#1}{\ShellEscape{\hv@rm \hv@extern@ExamplesDir\hvExternDateiname.##1}}
+ \ifnum\hv@extern@compilerNo=0\relax % we have metapost
+ \hv@rm epsf.*
+ \fi
}
\NewDocumentCommand\run@hv@extern@sequenceList{ m }
{
@@ -157,9 +161,9 @@
\newcommand\BodyVerbatim[2][]{\begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}}
-\newcommand\PreambleListing[2][]{\begin{tcolorbox}\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}}
+\newcommand\PreambleListing[2][]{\begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}}
-\newcommand\BodyListing[2][]{\begin{tcolorbox}\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}}
+\newcommand\BodyListing[2][]{\begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}}
\newcounter{hv@example@counter}
@@ -168,7 +172,7 @@
\@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
+}% {} ^^to prevent problems with lua comments
%%------------------ the config part --------------------
%\input{hvextern-mp.cfg}
@@ -260,6 +264,14 @@
{--StopVisiblePreamble}
+%---- Java
+\hv@extern@ExampleType{java}
+ {//StartVisibleMain}
+ {//StopVisibleMain}
+ {//StartVisiblePreamble}
+ {//StopVisiblePreamble}
+
+
%%%--------------------------------- end config part ------------------
%%
@@ -368,11 +380,13 @@
\fi
\ifhv@extern@code\else
\ifhv@extern@showFilename
+ \hv@typeout{>>>> Set filename in the margin!}%
\marginnote{\rotatebox{90}{\hvExternDateiname}}%
\fi
\fi
\ifhv@extern@moveToExampleDir
% \ShellEscape{mkdir\space\hv@extern@ExamplesDir/}%
+ \hv@typeout{>>>> Move file into example dir}%
\ShellEscape{\hv@move \hvExternDateiname.*\space \hv@extern@ExamplesDir}%
\fi
\ifhv@extern@includegraphic
@@ -380,8 +394,10 @@
\expandafter\includegraphics\expandafter[\hv@extern@grfOptions]{\hv@extern@ExamplesDir\hvExternDateiname}%
\else
\ifhv@extern@float
+ \hv@typeout{>>>> Floating environment}%
\begin{figure}[!htb]
\else
+ \hv@typeout{>>>> No floating environment}%
\ifdim\hv@extern@mpwidth>\z@
\hfill\minipage[t]{\dimexpr\linewidth-\hv@extern@mpwidth-1em\relax}\vspace{0pt}%
\else
@@ -389,6 +405,7 @@
\fi
\fi
\hv@extern@align
+ \hv@typeout{>>>> Input image \hv@extern@ExamplesDir\hvExternDateiname}%
\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}}%