texlive[63711] Master/texmf-dist: hvextern (24jun22)
commits+karl at tug.org
commits+karl at tug.org
Fri Jun 24 23:51:50 CEST 2022
Revision: 63711
http://tug.org/svn/texlive?view=revision&revision=63711
Author: karl
Date: 2022-06-24 23:51:50 +0200 (Fri, 24 Jun 2022)
Log Message:
-----------
hvextern (24jun22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/hvextern/Changes
trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex
trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
Added Paths:
-----------
trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-checkfile.lua
Modified: trunk/Master/texmf-dist/doc/latex/hvextern/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/Changes 2022-06-23 23:50:25 UTC (rev 63710)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/Changes 2022-06-24 21:51:50 UTC (rev 63711)
@@ -1,5 +1,7 @@
hvextern.sty ----------------
+v 0.32 2022-06-23 - fixed introduced bug
+ - 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
Modified: trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex 2022-06-23 23:50:25 UTC (rev 63710)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex 2022-06-24 21:51:50 UTC (rev 63711)
@@ -44,10 +44,10 @@
\usepackage[Option]{hvextern}
\end{verbatim}
-There exists only one option \Loption{checkCode} which is only valid
-for the use of \LuaLaTeX. In this case an already existing external file will only be compiled, if the
-code changed. This dosn't depends on the setting of the option \Lkeyword{force}.
-The package option will speed up the compilation time.
+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}.
+\Loption{checkCode} can speed up the compilation time.
\section{Syntax}
@@ -1832,6 +1832,19 @@
\runExtCmd[redirect,verbose]{ls -la}{voss}
+\begin{verbatim}
+\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\small}]{df}{voss}
+\end{verbatim}
+
+
+
+\medskip
+\runExtCmd[redirect,verbose,lstOptions={basicstyle=\ttfamily\footnotesize}]{df}{voss}
+
+
+
+
+
\section{Other options}
\begin{description}
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-checkfile.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-checkfile.lua (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-checkfile.lua 2022-06-24 21:51:50 UTC (rev 63711)
@@ -0,0 +1,42 @@
+#!/usr/bin/env texlua
+-----------------------------------------------------------------------
+-- FILE: hvextern-checkfile.lua
+-- DESCRIPTION: check two files for identical code
+-- REQUIREMENTS:
+-- AUTHOR: Herbert Voß
+-- LICENSE: LPPL1.3
+--
+-- $Id: hvextern.lua 578 2022-06-20 16:41:45Z herbert $
+-----------------------------------------------------------------------
+kpse.set_program_name("luatex")
+
+local f = kpse.find_file("hvextern.lua")
+require('hvextern')
+
+--[[
+function GetFileContents(f1,f2)
+ local NewContents, OldContents
+ local File = io.open(f1)
+ if File then
+ NewContents = File:read('*all')
+ File:close()
+ end
+ local File = io.open(f2)
+ if File then
+ OldContents = File:read('*all')
+ File:close()
+ end
+ return NewContents == OldContents
+end
+]]
+
+local f1 = arg[1]
+local f2 = arg[2]
+diffFile = io.open(f1..".diff","w+")
+if GetFileContents(f1,f2) then
+ diffFile:write("\\let\\hvCheckNewFile\\empty")
+else
+ diffFile:write("\\def\\hvCheckNewFile{Code changes}")
+end
+diffFile:close()
+
Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern-checkfile.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty 2022-06-23 23:50:25 UTC (rev 63710)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty 2022-06-24 21:51:50 UTC (rev 63711)
@@ -1,4 +1,4 @@
-%% $Id: hvextern.sty 577 2022-06-20 16:35:21Z herbert $
+%% $Id: hvextern.sty 579 2022-06-20 19:23:29Z herbert $
%% This is file `hvextern.sty',
%%
%% Copyright (C) 2016-22
@@ -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.31}
-\ProvidesFile{hvextern}[2022/06/20 v\hvexternFileversion: package for running external documents (HV)]
+\def\hvexternFileversion{0.32}
+\ProvidesFile{hvextern}[2022/06/23 v\hvexternFileversion: package for running external documents (HV)]
\newif\ifhv at extern@checkCode
\hv at extern@checkCodefalse
@@ -190,16 +190,16 @@
\ResetKeys
-\ifluatex
- \ifhv at extern@checkCode
+\ifhv at extern@checkCode
+ \ifluatex
\hv at ex@typeout{Loading hvextern.lua}%
- \directlua{dofile("hvextern.lua")}%
+ \directlua{kpse.set_program_name("luatex")require "hvextern.lua" }%
+ \else
+ \ifhv at extern@checkCode
+ \hv at ex@typeout{Using xelatex or pdflatex! Will use a temporary file for diff}%
+% \hv at extern@checkCodefalse
+ \fi
\fi
-\else
- \ifhv at extern@checkCode
- \hv at ex@typeout{You need lualatex for option checkCode. Will disable the option!}%
- \hv at extern@checkCodefalse
- \fi
\fi
{\catcode`\%=12
@@ -445,12 +445,27 @@
\expandafter\hvExternSetKeys\expandafter{\hv at extern@savePara}%
\xdef\hv at extern@fullPath{\hv at extern@ExamplesDir\hvExternDateiname}%
\ifhv at extern@checkCode
- \directlua{if GetFileContents("\hvExternDateiname\hv at extern@ext",
+ \ifluatex
+ \directlua{if GetFileContents("\hvExternDateiname\hv at extern@ext",
"\hv at extern@ExamplesDir\hvExternDateiname\hv at extern@ext") then
tex.print("\\csname hv at ex@typeout\\endcsname{current file is NOT newer: no run }\\global\\csname hv at extern@forcefalse\\endcsname")
else
tex.print("\\csname hv at ex@typeout\\endcsname{current file is newer: force run }\\global\\csname hv at extern@forcetrue\\endcsname")
- end}
+ end}%
+ \else
+ \hv at ex@typeout{Check, if new file has a different code}%
+ \ShellEscape{hvextern-checkfile "\hvExternDateiname\hv at extern@ext"
+ "\hv at extern@ExamplesDir\hvExternDateiname\hv at extern@ext"}%
+ \InputIfFileExists{\hvExternDateiname\hv at extern@ext.diff}{}{}%
+ \ifx\hvCheckNewFile\empty
+ \hv at ex@typeout{current file is NOT newer: no run }%
+ \global\hv at extern@forcefalse
+ \else
+ \hv at ex@typeout{current file is newer: force run }%
+ \global\hv at extern@forcetrue
+ \fi
+ \ifhv at extern@verbose\else\ShellEscape{\hv at rm \hvExternDateiname\hv at extern@ext.diff}\fi
+ \fi
\fi
\ifhv at extern@force
\ifx\hv at extern@runsequence\@empty
@@ -645,7 +660,7 @@
\newcommand\runExtCmd[3][]{%
\begingroup
- \setkeys{hv}{code=false,includegraphic=false,#1}%
+ \setkeys{hv}{cleanup={},code=false,includegraphic=false,#1}%
\xdef\hvExternDateiname{#3-\arabic{hv at example@counter}}%
\xdef\hv at extern@fullPath{\hv at extern@ExamplesDir\hvExternDateiname}%
\hv at ex@typeout{running #2}%
@@ -697,7 +712,7 @@
\ifhv at extern@usefancyvrb
\expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@fullPath.txt}
\else
- \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@fullPath.txt}
+ \expandafter\BodyListing\expandafter[\hv at extern@lstOptions,breakatwhitespace]{\hv at extern@fullPath.txt}
\fi
\ifx\hv at extern@caption\@empty\else\caption{\hv at extern@caption}\fi
\ifx\hv at extern@label\@empty\else\label{\hv at extern@label}\fi
@@ -707,7 +722,8 @@
\ifhv at extern@usefancyvrb
\expandafter\BodyVerbatim\expandafter[\hv at extern@lstOptions]{\hv at extern@fullPath.txt}
\else
- \expandafter\BodyListing\expandafter[\hv at extern@lstOptions]{\hv at extern@fullPath.txt}
+ \hv at extern@tcboxfalse
+ \expandafter\BodyListing\expandafter[\hv at extern@lstOptions,breaklines,breakatwhitespace]{\hv at extern@fullPath.txt}
\fi
\fi
\fi
More information about the tex-live-commits
mailing list.