summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hvextern
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-08-30 03:01:17 +0000
committerNorbert Preining <norbert@preining.info>2023-08-30 03:01:17 +0000
commit4fee29360f7566a474b6143951b0744fa151edc9 (patch)
tree1af77d3ca21368f054b09f30dd60e8028a91be62 /macros/latex/contrib/hvextern
parent64e26532c685fd24d6983508c6239e3c268b810b (diff)
CTAN sync 202308300301
Diffstat (limited to 'macros/latex/contrib/hvextern')
-rw-r--r--macros/latex/contrib/hvextern/Changes1
-rw-r--r--macros/latex/contrib/hvextern/doc/hvextern.pdfbin1478943 -> 1484026 bytes
-rw-r--r--macros/latex/contrib/hvextern/doc/hvextern.tex50
-rw-r--r--macros/latex/contrib/hvextern/latex/hvextern.sty42
4 files changed, 59 insertions, 34 deletions
diff --git a/macros/latex/contrib/hvextern/Changes b/macros/latex/contrib/hvextern/Changes
index 5c38357d6f..14afbfe9ed 100644
--- a/macros/latex/contrib/hvextern/Changes
+++ b/macros/latex/contrib/hvextern/Changes
@@ -1,5 +1,6 @@
hvextern.sty ----------------
+v 0.37 2023-08-29 - do not write files without --shell-escape
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
diff --git a/macros/latex/contrib/hvextern/doc/hvextern.pdf b/macros/latex/contrib/hvextern/doc/hvextern.pdf
index fddd186b01..21dd33cfdc 100644
--- a/macros/latex/contrib/hvextern/doc/hvextern.pdf
+++ b/macros/latex/contrib/hvextern/doc/hvextern.pdf
Binary files differ
diff --git a/macros/latex/contrib/hvextern/doc/hvextern.tex b/macros/latex/contrib/hvextern/doc/hvextern.tex
index 84b2df5183..ae1528783d 100644
--- a/macros/latex/contrib/hvextern/doc/hvextern.tex
+++ b/macros/latex/contrib/hvextern/doc/hvextern.tex
@@ -1,16 +1,21 @@
-%% $Id: hvextern.tex 749 2023-08-24 19:10:17Z herbert $
-\RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+%% $Id: hvextern.tex 753 2023-08-29 07:22:20Z herbert $
+%\RequirePackage{pdfmanagement-testphase}
+\DocumentMetadata{}
\documentclass[english,a4paper,twoside]{article}
\usepackage{babel}
\usepackage{libertinus}
\setmonofont[Scale=MatchLowercase,FakeStretch=0.88]{AnonymousPro}
+\newfontfamily\NotoSansMono[Ligatures=TeX,Scale=MatchLowercase,
+ FakeStretch=0.90,Ligatures=ResetAll%,RawFeature=-tlig
+ ]{Noto Sans Mono}
+\newfontfamily\CodeTwo{CODE2000}[Scale=MatchLowercase]
\usepackage{iftex}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{hvlogos}
-\usepackage[checkCode]{hvextern}
+\usepackage%[checkCode]
+{hvextern}
\usepackage{hvindex}
\usepackage{hvdoctools}
\usepackage{listings}
@@ -24,6 +29,8 @@
\def\Java{\textsf{Java}\xspace}
+
+
\begin{document}
\title{Writing, running and including the output of external documents
from within a main\newline \LaTeX\ document~--v. \hvexternFileversion}
@@ -48,7 +55,7 @@ showFilename,verbose}
There exists only one option \Loption{checkCode} which is valid
for all \TeX-compiler. In this case an already existing external file will only be compiled, if the
-external code changed. This dosn't depends on the setting of the option \Lkeyword{force}.
+external code changed. This doesn't depends on the setting of the option \Lkeyword{force}.
\Loption{checkCode} can speed up the compilation time.
\section{Syntax}
@@ -81,16 +88,12 @@ 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>
\end{verbatim}
-
-
-
The purpose for this package is to show the output of documents which have to be compiled with
a different preamble or a different engine or a complete different system, but integrating the output
automatically in the main document..
@@ -111,7 +114,7 @@ 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:\label{inline-exa}
+with \XeLaTeX\ and the output is insert as pdf image:
\begin{externalDocument}[%
compiler=xelatex, inline, force=true, runs=2, grfOptions={height=8pt},%
crop, cropmargin=0, cleanup, docType=latex,vshift=-1pt]{voss}
@@ -121,8 +124,9 @@ with \XeLaTeX\ and the output is insert as pdf image:\label{inline-exa}
美好的一天.
\end{document}
\end{externalDocument}
+The current filename of the above example is \hvExternFilename\ and for the source
+see page \pageref{inline-exa}.
-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}.
@@ -317,7 +321,7 @@ A vertical shift of the filename is possible by setting a length to the keyword
e.g. \texttt{shiftFN=5ex}.
-\clearpage%%%%%%%%%%%%
+%\clearpage%%%%%%%%%%%%
\begin{externalDocument}[grfOptions={width=0.95\linewidth},
compiler=xelatex,code,mpwidth=0.6\linewidth,
@@ -1072,10 +1076,10 @@ not part of your current font.
With the setting \LKeyset{inline=true} the optional keyword \Lkeyword{code} and \Lkeyword{showFilename}
is automatically set to false. The
-next Chinese characters
+next Chinese characters \label{inline-exa}
\begin{externalDocument}[
compiler=xelatex, inline, runs=2, grfOptions={height=8pt},
- crop, cropmargin=0,
+ crop, cropmargin=0, vshift=-1pt,usefancyvrb,
cleanup, force=true, docType=latex]{voss}%
\documentclass{ctexart}
\pagestyle{empty}
@@ -1086,11 +1090,12 @@ next Chinese characters
are inserted as \Index{inline image} without showing the code. The complete code looks like:
+\let\myFont\CodeTwo
-\begin{Verbatim}
+\begin{Verbatim}[fontfamily=myFont]
With \Lkeyset{inline} the optional argument \Lkeyword{code} is
automatically set to false. The next Chinese characters
-\begin{externalDocument}[
+\begin{externalDocument}[vshift=-1pt,
compiler=xelatex, inline, runs=2, grfOptions={height=8pt},
crop, cropmargin=0, cleanup, force=true, docType=latex]{voss}
\documentclass{ctexart}
@@ -1103,6 +1108,7 @@ are inserted as inline image without showing the code. The complete
code looks like:
\end{Verbatim}
+With the keyword \Lkeyword{vshift} the inserted image can be moed in vertically direction.
\subsection{Input text instead of an image}
By default the created pdf which can be, of course, only text, will be inserted by \Lcs{includegraphics}.
@@ -1267,7 +1273,7 @@ The following examples uses
mpwidth=0.6\linewidth,
usefancyvrb=false,
docType=latex]{voss}
-\documentclass[paper=a6,DIV=18,parskip=half-]{screxa}
+\documentclass[paper=a6,DIV=18,parskip=half-]{scrartcl}
\pagestyle{empty}
\usepackage{libertinus}
\setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase,FakeStretch=0.9]
@@ -1858,13 +1864,13 @@ to get the directory listed:
\begin{verbatim}
-\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\small}]{df}{voss}
+\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\small}]{du}{voss}% *nix
\end{verbatim}
\medskip
-\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\footnotesize}]{df}{voss}
+\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\small}]{du}{voss}
@@ -1883,8 +1889,10 @@ already exists, there is no need to create it with the next run again and again.
if the package option \Loption{checkCode} exists.
\item[\Lkeyword{cleanup}] the auxiliary files of a \LaTeX-run are deleted, preset to \texttt{aux}, \texttt{log}.
It must be a comma seperated list of the extensions of the main file, s.g. \texttt{cleanup=\{aux,log\}}.
-\item[\Lkeyword{moveToExampleDir}] name of a directory for the examples, must first be created by the user himself
-\item[\Lkeyword{ExampleDir}] move all examples into a directory
+\item[\Lkeyword{moveToExampleDir}] move all examples into a directory, must be set \emph{before} the
+option \Lkeyword{ExampleDir}.
+\item[\Lkeyword{ExampleDir}] name of a directory for the examples, must
+ first be created by the user himself.
\item[\Lkeyset{tclbox=false}] Can be used if there are some negative interactions between package \Lpack{listings}
and package \Lpack{tcolorbox}.
\item[\Lkeyword{framesep}] Value for \Lcs{fbox} if keyword \texttt{frame} is used.
diff --git a/macros/latex/contrib/hvextern/latex/hvextern.sty b/macros/latex/contrib/hvextern/latex/hvextern.sty
index 1304e197e7..5db1916c16 100644
--- a/macros/latex/contrib/hvextern/latex/hvextern.sty
+++ b/macros/latex/contrib/hvextern/latex/hvextern.sty
@@ -1,4 +1,4 @@
-%% $Id: hvextern.sty 749 2023-08-24 19:10:17Z herbert $
+%% $Id: hvextern.sty 753 2023-08-29 07:22:20Z 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.36}
-\ProvidesFile{hvextern}[2023/08/24 v\hvexternFileversion: package for running external documents (HV)]
+\def\hvexternFileversion{0.37}
+\ProvidesFile{hvextern}[2023/08/29 v\hvexternFileversion: package for running external documents (HV)]
\newif\ifhv@extern@checkCode
\hv@extern@checkCodefalse
@@ -21,7 +21,18 @@
\ProcessOptions
-\RequirePackage{shellesc,xkeyval,graphicx}
+\RequirePackage{shellesc,xkeyval,graphicx,comment}
+
+\newif\ifhv@extern@shellescape % the main command line option, for later test
+%\typeout{>>>> \the\ShellEscapeStatus}%
+\expandafter\ifnum\the\ShellEscapeStatus=1
+ \hv@extern@shellescapetrue
+ \typeout{>>>> command line option shell-escape is enabled!}%
+\else
+ \hv@extern@shellescapefalse
+ \typeout{>>>> command line option shell-escape is disabled!}%
+\fi
+
\RequirePackage{fancyvrb,tikz,listings,ifplatform,iftex}
\RequirePackage{ifoddpage,filemod}
\RequirePackage{tcolorbox,xparse}
@@ -29,7 +40,6 @@
\def\hv@ex@typeout#1{\ifhv@extern@verbose\typeout{>>(hvextern) #1}\fi}
-
\ifwindows
\def\hv@move{move }%
\def\hv@rm{del }%
@@ -198,6 +208,7 @@
\ResetKeys
+
\ifhv@extern@checkCode
\ifluatex
\hv@ex@typeout{Loading hvextern.lua}%
@@ -442,13 +453,19 @@
\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
+ \global\hv@extern@forcetrue}}}% set force, if no pdf or png or txt exists
\begingroup
- \hv@ex@typeout{writing file \hvExternFilename\hv@extern@ext ...}%
+ \ifhv@extern@shellescape
+ \hv@ex@typeout{writing file \hvExternFilename\hv@extern@ext ...}%
+ \else
+ \hv@ex@typeout{no shell-escape, no writing of file \hvExternFilename\hv@extern@ext}%
+ \let\filecontents\comment
+ \let\endfilecontents\endcomment
+ \fi
\filecontents[force,noheader]{\hvExternFilename\hv@extern@ext}%
}
- {\endfilecontents% \end%
- \hv@ex@typeout{... done}%
+ {\endfilecontents
+ \ifhv@extern@shellescape\hv@ex@typeout{... done}\fi
\global\stepcounter{hv@example@counter}%
\endgroup
\expandafter\hvExternSetKeys\expandafter{\hv@extern@savePara}%
@@ -691,10 +708,9 @@
\fi
\fi
\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}%
+ \ifhv@extern@force
+ \expandafter\run@hv@extern@cleanup\expandafter{\hv@extern@cleanup}%
+ \fi% cleanup
\vspace{\hv@extern@belowskip}%
}