diff options
author | Karl Berry <karl@freefriends.org> | 2023-08-29 23:20:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-08-29 23:20:30 +0000 |
commit | a6264258ab394f5b4ce36ecbee7dc67ef8c4d51c (patch) | |
tree | bf1a7afd8903b51e7e15b0f6008bfaefde345264 /Master/texmf-dist/tex/latex | |
parent | 4931885dfd0ba77dba495413098ad4b1a32748ff (diff) |
hvextern (30aug23)
git-svn-id: svn://tug.org/texlive/trunk@68104 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/hvextern/hvextern.sty | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/hvextern/hvextern.sty b/Master/texmf-dist/tex/latex/hvextern/hvextern.sty index 1304e197e74..5db1916c169 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 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}% } |