From f4e5abab37713aa90bc4ffa3711a0ea89ad15800 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 8 Oct 2020 21:48:27 +0000 Subject: new latex hook mechanism, minted, catchfile, tex4ht r808-810 git-svn-id: svn://tug.org/texlive/trunk@56601 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/generic/tex4ht/catchfile-sty-hooks.4ht | 35 ++++++++++++++++++++ .../tex/generic/tex4ht/minted-sty-hooks.4ht | 25 +++++++++++++++ Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty | 10 ++++-- .../texmf-dist/tex/generic/tex4ht/usepackage.4ht | 37 ++++++++++------------ 4 files changed, 84 insertions(+), 23 deletions(-) create mode 100644 Master/texmf-dist/tex/generic/tex4ht/catchfile-sty-hooks.4ht create mode 100644 Master/texmf-dist/tex/generic/tex4ht/minted-sty-hooks.4ht (limited to 'Master/texmf-dist/tex/generic') diff --git a/Master/texmf-dist/tex/generic/tex4ht/catchfile-sty-hooks.4ht b/Master/texmf-dist/tex/generic/tex4ht/catchfile-sty-hooks.4ht new file mode 100644 index 00000000000..6f056418644 --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex4ht/catchfile-sty-hooks.4ht @@ -0,0 +1,35 @@ +% catchfile-sty-hook.4ht, generated from tex4ht-4ht.tex +% Copyright 2020 TeX Users Group +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any +% later version. The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions +% of LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainer of this work +% is the TeX4ht Project . +% +% If you modify this program, changing the +% version identification would be appreciated. +\immediate\write-1{version 2020-10-08-14:12} + +\AddToHook{package/after/catchfile}{ + \def\CatchFile@CheckFileExists#1{% + \IfFileExists{#1}{% + \expandafter\CatchFile@DefFile\@filef@und\@nil + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname @addtofilelist\endcsname\relax + \else + \@addtofilelist{#1} + \fi + }{% + \let\CatchFile@File\relax + }% + }% +} + diff --git a/Master/texmf-dist/tex/generic/tex4ht/minted-sty-hooks.4ht b/Master/texmf-dist/tex/generic/tex4ht/minted-sty-hooks.4ht new file mode 100644 index 00000000000..6274f0ee498 --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex4ht/minted-sty-hooks.4ht @@ -0,0 +1,25 @@ +% minted-sty-hook.4ht, generated from tex4ht-4ht.tex +% Copyright 2020 TeX Users Group +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any +% later version. The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions +% of LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainer of this work +% is the TeX4ht Project . +% +% If you modify this program, changing the +% version identification would be appreciated. +\immediate\write-1{version 2020-10-08-14:12} + +\AddToHook{package/after/minted}{% +\@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}} +\define@booleankey{minted@opt@g}{breaklines}{}{}{}% +} + diff --git a/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty b/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty index f86d80b4902..af981b9b880 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty +++ b/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty @@ -1,7 +1,7 @@ \ifnum\the\catcode`\%=14\else\expandafter\edef\csname \string:RestoreCatcodes\endcsname{\catcode`\%\the \catcode`\%}\catcode`\%14\fi -% tex4ht.sty (2020-07-28-14:30), generated from tex4ht-sty.tex +% tex4ht.sty (2020-10-08-14:12), generated from tex4ht-sty.tex % Copyright 2009-2020 TeX Users Group % Copyright 1996-2009 Eitan M. Gurari % @@ -20,7 +20,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2020-07-28-14:30} +\immediate\write-1{version 2020-10-08-14:12} \ifx \Preamble\UnDef \else @@ -680,12 +680,16 @@ \catcode`:=\the\catcode`:% \catcode`@=\the\catcode`@}% \catcode`\:=11 \catcode`\@=11 -\a:usepackage +\a:usepackage% + \a:usepackage:lthooks{#1}{#4} \TivhTcats }% \def\:currentoptions{#2} \:onefilewithoptions#1[#2][#3]{#4}\package:hooks{#1.#4}} \def\a:usepackage{\input usepackage.4ht } +\def\a:usepackage:lthooks#1#2{% + \IfFileExists{#1-#2-hooks.4ht}{\input #1-#2-hooks.4ht}{}% +} \expandafter\ifx \csname tex4ht\endcsname\relax diff --git a/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht b/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht index b8d64095175..05d2684a595 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht @@ -1,4 +1,4 @@ -% usepackage.4ht (2020-09-21-13:54), generated from tex4ht-4ht.tex +% usepackage.4ht (2020-10-08-14:12), generated from tex4ht-4ht.tex % Copyright 2003-2009 Eitan M. Gurari % Copyright 2009-2020 TeX Users Group % @@ -17,7 +17,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2020-09-21-13:54} +\immediate\write-1{version 2020-10-08-14:12} \def\:temp{tex4ht}\ifx \:temp\@currname \:warning{\string\usepackage{tex4ht} again?} @@ -33,7 +33,7 @@ \fi \fi -\gdef\a:usepackage{\use:package cleveref,xr,xr-hyper,eso-pic,showframe,expl3,savetrees,biblatex,xeCJK,ctex,polyglossia,fontspec,tikz,pdfbase,caption,graphics,xcolor,imakeidx,minted,fancyhdr,,!*?: } +\gdef\a:usepackage{\use:package cleveref,xr,xr-hyper,eso-pic,showframe,expl3,savetrees,biblatex,xeCJK,ctex,polyglossia,fontspec,tikz,pdfbase,caption,graphics,xcolor,imakeidx,fancyhdr,,!*?: } \gdef\use:package#1,{% \if :#1:\def\:temp##1!*?: {}\else \def\:temp{#1}\ifx \@currname\:temp @@ -143,22 +143,24 @@ \def\:temp{polyglossia}\ifx \@currname\:temp \ExplSyntaxOn \:AtEndOfPackage{ - +\ifdefined\orig_polyglossia@keys_define_lang:n\else \cs_set_eq:NN\orig_polyglossia@keys_define_lang:n\polyglossia@keys_define_lang:n +%\let\orig_polyglossia@keys_define_lang:n\polyglossia@keys_define_lang:n \cs_set_protected:Npn \polyglossia@keys_define_lang:n #1 { - \orig_polyglossia@keys_define_lang:n{#1} - \keys_define:nn {polyglossia}{ - #1 / direction - . code:n = {}, - #1 / script - . code:n = {\ifdefined\XeTeXversion - \edef\:tempscript{\str_uppercase:f{\tl_head:n {#1}}\tl_tail:n{#1}} - \xeuniuseblock{#1} - \expandafter\xeuniuseblock\expandafter{\:tempscript} - \fi}, - } + \orig_polyglossia@keys_define_lang:n{#1} + \keys_define:nn {polyglossia}{ + #1 / direction + . code:n = {}, + #1 / script + . code:n = {\ifdefined\XeTeXversion + \edef\:tempscript{\str_uppercase:f{\tl_head:n {#1}}\tl_tail:n{#1}} + \xeuniuseblock{#1} + \expandafter\xeuniuseblock\expandafter{\:tempscript} + \fi}, + } } \def\RequireBidi{}% +\fi } \ExplSyntaxOff \fi @@ -217,11 +219,6 @@ \def\:temp{imakeidx}\ifx\@currname\:temp \PassOptionsToPackage{noautomatic}{imakeidx} \fi -\def\:temp{minted}\ifx\@currname\:temp - \:AtEndOfPackage{% - \define@booleankey{minted@opt@g}{breaklines}{}{}{}% - } -\fi \def\:temp{fancyhdr}\ifx\@currname\:temp \:AtEndOfPackage{% \def\ps@fancy{}% -- cgit v1.2.3