texlive[63664] Master: hvextern (20jun22)
commits+karl at tug.org
commits+karl at tug.org
Mon Jun 20 23:07:45 CEST 2022
Revision: 63664
http://tug.org/svn/texlive?view=revision&revision=63664
Author: karl
Date: 2022-06-20 23:07:45 +0200 (Mon, 20 Jun 2022)
Log Message:
-----------
hvextern (20jun22)
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
trunk/Master/tlpkg/libexec/ctan2tds
Added Paths:
-----------
trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.lua
Modified: trunk/Master/texmf-dist/doc/latex/hvextern/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/latex/hvextern/Changes 2022-06-20 21:06:31 UTC (rev 63663)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/Changes 2022-06-20 21:07:45 UTC (rev 63664)
@@ -1,5 +1,7 @@
hvextern.sty ----------------
+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
overfull box messages
v 0.29 2022-06-06 - use skin "enhanced jigsaw" for tcolorbox
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-20 21:06:31 UTC (rev 63663)
+++ trunk/Master/texmf-dist/doc/latex/hvextern/hvextern.tex 2022-06-20 21:07:45 UTC (rev 63664)
@@ -1,4 +1,4 @@
-%% $Id: hvextern.tex 574 2022-06-09 19:34:31Z herbert $
+%% $Id: hvextern.tex 577 2022-06-20 16:35:21Z herbert $
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass[ngerman,a4paper,twoside]{article}
@@ -10,7 +10,7 @@
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{hvlogos}
-\usepackage{hvextern}
+\usepackage[checkCode]{hvextern}
\usepackage{hvindex}
\usepackage{hvdoctools}
\usepackage{listings}
@@ -34,15 +34,25 @@
%\newpage
\setkeys{hv}{moveToExampleDir,ExampleDir=Exa,showFilename,verbose}
-\section{Syntax}
+
+\clearpage
+
+\section{Loading the package}
+
\begin{verbatim}
-\usepackage{hvextern}
+\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.
+
+\section{Syntax}
+
\addtocontents{toc}{\protect\enlargethispage{2ex}}
-
\begin{sloppypar}
This package allows to write external \MP, \TeX, \ConTeXt, \LaTeX, \LuaTeX, \LuaLaTeX, \XeTeX, \XeLaTeX,
\Index{Lua}, \Index{Perl}, \Index{Java} and/or \Index{Python}
@@ -96,7 +106,7 @@
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:
\begin{externalDocument}[%
- compiler=xelatex, inline, force, runs=2, grfOptions={height=8pt},%
+ compiler=xelatex, inline, force=false, runs=2, grfOptions={height=8pt},%
crop, cropmargin=0, cleanup, docType=latex]{voss}
\documentclass{ctexart}
\pagestyle{empty}
@@ -112,7 +122,7 @@
\begin{minipage}{.59\linewidth}
\begin{lstlisting}
\begin{externalDocument}[
- compiler=pdflatex,force,cleanup]{voss}
+ compiler=pdflatex,force=false,cleanup]{voss}
\documentclass{standalone}
%StartVisiblePreamble
\usepackage{fontenc}
@@ -136,7 +146,7 @@
\end{minipage}
\begin{minipage}{.39\linewidth}
\begin{externalDocument}[
- compiler=pdflatex,force=true,cleanup={log,aux},showFilename=false]{voss}
+ compiler=pdflatex,force=false,cleanup={log,aux},showFilename=false]{voss}
\documentclass{standalone}
%StartVisiblePreamble
\usepackage{fontenc}
@@ -192,7 +202,7 @@
compiler=python3,
code,
ext=py,
- force=true,
+ force=false,
docType=py,
usefancyvrb,
grfOptions={width=\linewidth}]{python}
@@ -242,7 +252,7 @@
\begin{externalDocument}[
compiler=python3,
progpath=/usr/local/bin/,
- force=true,
+ force=false,
runs=1,
code,
ext=py,
@@ -292,6 +302,8 @@
column, then use the keyword \Lkeyword{outerFN}. Then \Lpack{hvextern} doesn't
test for twocolumn mode.
+\enlargethispage{\normalbaselineskip}
+
A vertical shift of the filename is possible by setting a length to the keyword \Lkeyword{shiftFN},
e.g. \texttt{shiftFN=5ex}.
@@ -300,7 +312,7 @@
\begin{externalDocument}[grfOptions={width=0.95\linewidth},
compiler=xelatex,code,mpwidth=0.6\linewidth,
- crop,cleanup,force=true,usefancyvrb=false,ext=tex,showFilename=false]{voss}
+ crop,cleanup,force=false,usefancyvrb=false,ext=tex,showFilename=false]{voss}
\documentclass{article}
%StartVisiblePreamble
\usepackage{tikz}
@@ -412,7 +424,7 @@
runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex},
,
verbose,
- force=true,
+ force=false,
cleanup={log,aux,toc,bbl,blg},
code,docType=latex,
lstOptions={columns=fixed}]{voss}
@@ -451,7 +463,7 @@
\begin{externalDocument}[
verbose,
compiler=java,ext=java,code,
- force=true,docType=java,includegraphic,
+ force=false,docType=java,includegraphic,
usefancyvrb,grfOptions={width=0.9\linewidth}]{java}
import java.awt.Color;
import java.awt.Graphics;
@@ -582,7 +594,7 @@
mpwidth=0.6\linewidth,
crop,
cleanup,
- force=true,
+ force=false,
docType=latex]{voss}
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
@@ -630,7 +642,7 @@
mpwidth=0.6\linewidth,
crop,
cleanup,
- force=true,
+ force=false,
usefancyvrb,
docType=latex]{voss}
\RequirePackage{pdfmanagement-testphase}
@@ -717,7 +729,7 @@
% mpwidth=0.6\linewidth,
% crop,
cleanup,
- force=true,
+ force=false,
frame,
% usefancyvrb,
% float,
@@ -770,7 +782,7 @@
% mpwidth=0.6\linewidth,
crop,
cleanup,
- force=true,
+ force=false,
usefancyvrb,
float,
floatsetting=!ht,
@@ -833,7 +845,7 @@
% mpwidth=0.6\linewidth,
crop, cropmargin=5,
cleanup,
- force=true,
+ force=false,
frame,
% usefancyvrb,
% float,
@@ -894,7 +906,7 @@
showFilename=false,
crop,
cleanup,
- force=true,
+ force=false,
docType=latex]{voss}
\documentclass{article}
\pagestyle{empty}
@@ -918,7 +930,7 @@
code,
crop,
cleanup,
- force=true,
+ force=false,
docType=latex]{voss}
\documentclass{article}
\pagestyle{empty}
@@ -943,7 +955,7 @@
showFilename=false,
crop,
cleanup,
- force=true,
+ force=false,
docType=latex]{voss}
\documentclass{article}
\pagestyle{empty}
@@ -968,7 +980,7 @@
crop,
showFilename=false,
cleanup,
- force=true,
+ force=false,
mpwidth=0.5\linewidth,
docType=latex]{voss}
\documentclass{article}
@@ -993,7 +1005,7 @@
showFilename=false,
crop,
cleanup,
- force=true,
+ force=false,
mpwidth=0.5\linewidth,
docType=latex]{voss}
\documentclass{article}
@@ -1019,7 +1031,7 @@
showFilename=false,
crop,
cleanup,
- force=true,
+ force=false,
mpwidth=0.5\linewidth,
docType=latex]{voss}
\documentclass{article}
@@ -1049,7 +1061,7 @@
\begin{externalDocument}[
compiler=xelatex, inline, runs=2, grfOptions={height=8pt},
crop, cropmargin=0,
- cleanup, force=true, docType=latex]{voss}%
+ cleanup, force=false, docType=latex]{voss}%
\documentclass{ctexart}
\pagestyle{empty}
\begin{document}
@@ -1065,7 +1077,7 @@
automatically set to false. The next Chinese characters
\begin{externalDocument}[
compiler=xelatex, inline, runs=2, grfOptions={height=8pt},
- crop, cropmargin=0, cleanup, force=true, docType=latex]{voss}
+ crop, cropmargin=0, cleanup, force=false, docType=latex]{voss}
\documentclass{ctexart}
\pagestyle{empty}
\begin{document}
@@ -1104,7 +1116,7 @@
\begin{externalDocument}[
- compiler=perl, force=true, docType=pl, ext=pl, includegraphic=false,
+ compiler=perl, force=false, docType=pl, ext=pl, includegraphic=false,
code, mpwidth=0.6\linewidth]{voss}
#!/usr/bin/perl
#
@@ -1159,7 +1171,7 @@
\begin{externalDocument}[
- compiler=lua, force=true, docType=lua, ext=lua, includegraphic=false,
+ compiler=lua, force=false, docType=lua, ext=lua, includegraphic=false,
code, usefancyvrb=false,textOptions={basicstyle=\ttfamily\footnotesize},
shiftFN=6ex]{voss}
#!/usr/bin/env lua
@@ -1234,7 +1246,7 @@
pages=2,
crop,
cleanup,
- force=true,
+ force=false,
xindex,
xindexOptions={-l DE --config AU},
mpwidth=0.6\linewidth,
@@ -1290,7 +1302,7 @@
frame,
runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex},
verbose,
- force=true,
+ force=false,
cleanup={log,aux,toc,bbl,blg},
code,docType=latex,
lstOptions={columns=fixed}]{voss}
@@ -1330,7 +1342,7 @@
pages={1,3},
frame,compiler=pdflatex,
% crop,
- force=true,runs=2,code,docType=latex,
+ force=false,runs=2,code,docType=latex,
frame,
lstOptions={columns=fixed}]{voss}
%StartVisiblePreamble
@@ -1390,7 +1402,7 @@
frame,compiler=pdflatex,
showFilename,
% crop,
- force=true,runs=2,code,docType=latex,
+ force=false,runs=2,code,docType=latex,
frame,framesep=0pt,usefancyvrb]{voss}
%StartVisiblePreamble
\documentclass[chapterprefix=on,parskip=half-,DIV=12,fontsize=12pt]{scrbook}
@@ -1474,7 +1486,7 @@
showoutput=false,
frame,compiler=pdflatex,
crop,
- force,runs=2,code,docType=latex,
+ force=false,runs=2,code,docType=latex,
frame,usefancyvrb]{voss}
%StartVisiblePreamble
\documentclass[chapterprefix=on,parskip=half-,DIV=12,fontsize=12pt]{scrbook}
@@ -1550,7 +1562,7 @@
frame,
compiler=pdflatex,
showFilename,
- force=true,
+ force=false,
runs=2,code,docType=ltx,
usefancyvrb]{voss}
\documentclass[chapterprefix=on,parskip=half-,DIV=12,fontsize=12pt]{scrreprt}
@@ -1614,7 +1626,7 @@
compiler=mpost,
showFilename,
% crop,
- force=true,
+ force=false,
cleanup,
code,
docType=mp,
@@ -1650,7 +1662,7 @@
compiler=tex,
showFilename,
% crop,
- force=true,
+ force=false,
code,
docType=tex,
ext=tex,]{voss}
@@ -1716,7 +1728,7 @@
compiler=lualatex,
showFilename,
crop,
- force=true,
+ force=false,
code,
docType=latex,
ext=tex,]{voss}
@@ -1758,7 +1770,7 @@
compiler=context,
showFilename,
runs=2,
- force=true,
+ force=false,
code,
docType=context,
ext=tex,]{voss}
@@ -1769,9 +1781,9 @@
\setuphead
[myhead]
[numberstyle=bold,
- textstyle=bold,
- before=\hairline\blank,
- after=\nowhitespace\hairline]
+ textstyle =bold,
+ before =\hairline\blank,
+ after =\nowhitespace\hairline]
%StopVisiblePreamble
\starttext
\startstandardmakeup
@@ -1797,7 +1809,7 @@
\chapter[cuyler]{The Cuyler family}
... much later Tydeman Cuyler ...
\input knuth
-\myhead[headlines]{And the end}
+\myhead[headlines]{And the end of all}
foo
\stoptext
\end{externalDocument}
@@ -1829,7 +1841,8 @@
% to get the filename on the right or left of the whole page.
%\item[\Lkeyword{shiftFN}] A length to move the printed filename up or down.
\item[\Lkeyset{force=false}] can speed up the comiling time for the document. If a created image/output
-already exists, there is no need to create it with the next run again and again.
+already exists, there is no need to create it with the next run again and again. \emph This option is not valid
+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{copyToExampleDir}] name of a directory for the examples, must first be created by the user himself
Added: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.lua (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.lua 2022-06-20 21:07:45 UTC (rev 63664)
@@ -0,0 +1,28 @@
+-----------------------------------------------------------------------
+-- FILE: hvextern.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")
+
+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]
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.lua
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ 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-20 21:06:31 UTC (rev 63663)
+++ trunk/Master/texmf-dist/tex/latex/hvextern/hvextern.sty 2022-06-20 21:07:45 UTC (rev 63664)
@@ -1,4 +1,4 @@
-%% $Id: hvextern.sty 574 2022-06-09 19:34:31Z herbert $
+%% $Id: hvextern.sty 577 2022-06-20 16:35:21Z herbert $
%% This is file `hvextern.sty',
%%
%% Copyright (C) 2016-22
@@ -12,21 +12,33 @@
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
-\def\hvexternFileversion{0.30}
-\ProvidesFile{hvextern}[2022/06/09 v\hvexternFileversion: package for running external documents (HV)]
+\def\hvexternFileversion{0.31}
+\ProvidesFile{hvextern}[2022/06/20 v\hvexternFileversion: package for running external documents (HV)]
+\newif\ifhv at extern@checkCode
+\hv at extern@checkCodefalse
+\DeclareOption{checkCode}{\hv at extern@checkCodetrue}
+
+\ProcessOptions
+
\RequirePackage{shellesc,xkeyval,graphicx}
-\RequirePackage{fancyvrb,tikz,listings,ifplatform}
-\RequirePackage{ifoddpage}
+\RequirePackage{fancyvrb,tikz,listings,ifplatform,iftex}
+\RequirePackage{ifoddpage,filemod}
\RequirePackage{tcolorbox,xparse}
\tcbuselibrary{skins,breakable}
+\def\hv at ex@typeout#1{\ifhv at extern@verbose\typeout{>>(hvextern) #1}\fi}
+
\ifwindows
\def\hv at move{move }%
\def\hv at rm{del }%
+ \def\hv at mkdir{mkdir }%
\else
- \def\hv at move{mv }
- \def\hv at rm{rm }
+ \def\hv at move{mv }%
+ \def\hv at move{mv }%
+ \def\hv at rm{rm }%
+ \def\hv at mkdir{mkdir -p }%
+ \def\hv at diff{diff }
\fi
\newcounter{hv at extern@runs}
@@ -105,7 +117,6 @@
}
\define at boolkey{hv}[hv at extern@]{eps}[true]{}
\define at boolkey{hv}[hv at extern@]{verbose}[true]{}
-\def\hv at ex@typeout#1{\ifhv at extern@verbose\typeout{>>(hvextern) #1}\fi}
\define at choicekey*+{hv}{compiler}[\val\nr]{mpost,tex,latex,luatex,python3,perl,lua,java,%
xetex,pdflatex,lualatex,xelatex,context,sh,texlua}[pdflatex]{%
@@ -177,9 +188,20 @@
}%
}
-
\ResetKeys
+\ifluatex
+ \ifhv at extern@checkCode
+ \hv at ex@typeout{Loading hvextern.lua}%
+ \directlua{dofile("hvextern.lua")}%
+ \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
\catcode`\#=12
\gdef\perCent{%}
@@ -422,6 +444,14 @@
\endgroup
\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",
+ "\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}
+ \fi
\ifhv at extern@force
\ifx\hv at extern@runsequence\@empty
\hv at ex@typeout{force=true: running \hv at extern@progpath\hv at extern@compiler~ \hvExternDateiname\hv at extern@ext ...}%
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds 2022-06-20 21:06:31 UTC (rev 63663)
+++ trunk/Master/tlpkg/libexec/ctan2tds 2022-06-20 21:07:45 UTC (rev 63664)
@@ -2059,7 +2059,7 @@
'mhchem', 'hpstatement.inc|' . $standardtex,
'hrefhide', '\.sty|[^c]\.cfg', # omit ltxdoc.cfg, would be system-wide
'huawei', '.*cover-picture\.pdf|' . $standardtex,
- 'hvextern', 'hv(?!doctools).*\.sty', # negative lookahead fun
+ 'hvextern', 'hv(?!doctools).*\.sty|\.lua', # negative lookahead fun
'hyper', '^[^d].*\.sty|\.hyp', # not defpattern.sty
'hyphenex', 'ushyphex\.tex',
'hyplain', '(hyrules|hy.*plain|hylang)\..*',
More information about the tex-live-commits
mailing list.