texlive[72541] Master/texmf-dist: LaTeX cmd hooks, e.g.

commits+karl at tug.org commits+karl at tug.org
Sun Oct 13 23:26:33 CEST 2024


Revision: 72541
          https://tug.org/svn/texlive?view=revision&revision=72541
Author:   karl
Date:     2024-10-13 23:26:32 +0200 (Sun, 13 Oct 2024)
Log Message:
-----------
LaTeX cmd hooks, e.g. for ltugboat, tex4ht r1581

Revision Links:
--------------
    https://tug.org/svn/texlive?view=revision&revision=1581

Modified Paths:
--------------
    trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
    trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
    trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-info.tex
    trunk/Master/texmf-dist/tex/generic/tex4ht/latex.4ht

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2024-10-13 20:22:39 UTC (rev 72540)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2024-10-13 21:26:32 UTC (rev 72541)
@@ -1,3 +1,9 @@
+2024-10-13  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (latex.4ht): fixed support for LaTeX cmd hooks in
+	\@sect and \@ssect commands.
+	http://puszcza.gnu.org.ua/bugs/?639
+
 2024-10-10  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-mathml.tex (mathml.4ht): removed spurious space after

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2024-10-13 20:22:39 UTC (rev 72540)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2024-10-13 21:26:32 UTC (rev 72541)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1579 2024-10-10 21:25:46Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1581 2024-10-13 11:33:56Z michal_h21 $
 % tex tex4ht-4ht   or   ht tex tex4ht-4ht
 %
 % Copyright 2009-2024 TeX Users Group    
@@ -12067,14 +12067,32 @@
 \def\no at sect#1#2#3#4#5{\no:sect{#1}{#2}{#3}{#4}{0ex}}
 >>>
 
+The LaTeX command hook mechanism doesn't like our redefinitions of 
+\''\@sect' and \''\@ssect', so we need to declare and use them explicitly. 
+Otherwise, packages that try to add hooks to these commands may cause errors.
+See \Link[http://puszcza.gnu.org.ua/bugs/?639]{}{} this bug report\EndLink.
+
 \<latex ltsect\><<<
+\NewHookWithArguments{cmd/@sect/before}{8}
+\NewReversedHookWithArguments{cmd/@sect/after}{8}
+\NewHookWithArguments{cmd/@ssect/before}{5}
+\NewReversedHookWithArguments{cmd/@ssect/after}{5}
+>>>
+
+\<latex ltsect\><<<
 \let\no at ssect|=\@ssect
-\def\@ssect#1#2#3#4#5{\:Sc3
-   \no at ssect{#1}{#2}{#3}{#4}{\:Sc4#5\:Sc2}\HtmlEnv}
+\def\@ssect#1#2#3#4#5{%
+  \UseHookWithArguments{cmd/@ssect/before}{5}{##1}{##2}{##3}{##4}{##5}%
+  \:Sc3\no at ssect{#1}{#2}{#3}{#4}{\:Sc4#5\:Sc2}\HtmlEnv%
+  \UseHookWithArguments{cmd/@ssect/after}{5}{##1}{##2}{##3}{##4}{##5}%
+}
 \let\no at sect|=\@sect
 \def\@sect#1#2#3#4#5#6[#7]#8{%
-   \xdef\c:secnumdepth{#2}\:Sc3
-   \no at sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{\:Sc4#8\:Sc2}\HtmlEnv}
+   \UseHookWithArguments{cmd/@sect/before}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
+   \xdef\c:secnumdepth{#2}\:Sc3%
+   \no at sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{\:Sc4#8\:Sc2}\HtmlEnv%
+   \UseHookWithArguments{cmd/@sect/after}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
+ }
 \let\:startsection|=\@startsection
 \def\@startsection#1{\@ifstar{\Configure{secType}{like#1}}%
    {\Configure{secType}{#1}}%
@@ -12119,6 +12137,7 @@
 
 \<redf sec\><<<
 \def\@sect##1##2##3##4##5##6[##7]##8{%
+   \UseHookWithArguments{cmd/@sect/before}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
    |<disable @seccntformat|>%
    \let\@sect|=\no at sect   \xdef\c:secnumdepth{##2}%
    {\SkipRefstepAnchor \let\addcontentsline|=\:gobbleIII \let\mark|=\:gobble
@@ -12125,7 +12144,9 @@
     \no at sect{##1}{##2}{##3}{##4}{##5}{##6}[{##7}]{}}%
    |<recall Sc, sec, ssec|>%
    |<restore @seccntformat|>%
-   \HtmlEnv    \Toc:Title{##7}\csname no:#1\endcsname{##8}}%
+   \HtmlEnv    \Toc:Title{##7}\csname no:#1\endcsname{##8}%
+   \UseHookWithArguments{cmd/@sect/after}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
+ }%
 >>>
 
 In the above we want \`'[{##7}]' instead of \`'[##7]', in case `]' is
@@ -12135,12 +12156,15 @@
 
 \<redf ssec\><<<
 \def\@ssect##1##2##3##4##5{%
+   \UseHookWithArguments{cmd/@ssect/before}{5}{##1}{##2}{##3}{##4}{##5}%
    |<star sec title|>%
    \let\@ssect|=\no at ssect
    {\def\addcontentsline####1####2####3{}%
     \no at ssect{##1}{##2}{##3}{##4}{}}%
    |<recall Sc, sec, ssec|>%
-   \HtmlEnv   \csname :like#1\endcsname{##5}}%
+   \HtmlEnv   \csname :like#1\endcsname{##5}%
+   \UseHookWithArguments{cmd/@ssect/after}{5}{##1}{##2}{##3}{##4}{##5}%
+ }%
 >>>
 
 \<sv Sc, sec, ssec\><<<

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-info.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-info.tex	2024-10-13 20:22:39 UTC (rev 72540)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-info.tex	2024-10-13 21:26:32 UTC (rev 72541)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-info.tex 1556 2024-09-23 10:50:11Z michal_h21 $
+% $Id: tex4ht-info.tex 1564 2024-09-29 14:56:20Z karl $
 % Compile with the command `ht latex tex4ht-info'
 % or
 % compile 3 times: latex tex4ht-info   
@@ -33,7 +33,7 @@
 
 \<info4ht\><<<
 % info4ht.4ht (|version), generated from |jobname.tex
-% Copyright 2009-2021 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
 % Copyright |CopyYear.2000. Eitan M. Gurari
 %
 % This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/latex.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/latex.4ht	2024-10-13 20:22:39 UTC (rev 72540)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/latex.4ht	2024-10-13 21:26:32 UTC (rev 72541)
@@ -1,4 +1,4 @@
-% latex.4ht (2024-09-24-10:22), generated from tex4ht-4ht.tex
+% latex.4ht (2024-10-13-14:26), generated from tex4ht-4ht.tex
 % Copyright 1997-2009 Eitan M. Gurari
 % Copyright 2009-2024 TeX Users Group
 %
@@ -17,7 +17,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2024-09-24-10:22}
+\immediate\write-1{version 2024-10-13-14:26}
 
 \ifx\SaveMkHalignConf:g\:UnDef \else \expandafter\endinput\fi
 
@@ -1344,13 +1344,23 @@
 \append:def\@endtheorem{\c:newtheorem}
 \NewConfigure{newtheorem}{3}
        
+\NewHookWithArguments{cmd/@sect/before}{8}
+\NewReversedHookWithArguments{cmd/@sect/after}{8}
+\NewHookWithArguments{cmd/@ssect/before}{5}
+\NewReversedHookWithArguments{cmd/@ssect/after}{5}
 \let\no at ssect\@ssect
-\def\@ssect#1#2#3#4#5{\:Sc3
-   \no at ssect{#1}{#2}{#3}{#4}{\:Sc4#5\:Sc2}\HtmlEnv}
+\def\@ssect#1#2#3#4#5{%
+  \UseHookWithArguments{cmd/@ssect/before}{5}{##1}{##2}{##3}{##4}{##5}%
+  \:Sc3\no at ssect{#1}{#2}{#3}{#4}{\:Sc4#5\:Sc2}\HtmlEnv%
+  \UseHookWithArguments{cmd/@ssect/after}{5}{##1}{##2}{##3}{##4}{##5}%
+}
 \let\no at sect\@sect
 \def\@sect#1#2#3#4#5#6[#7]#8{%
-   \xdef\c:secnumdepth{#2}\:Sc3
-   \no at sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{\:Sc4#8\:Sc2}\HtmlEnv}
+   \UseHookWithArguments{cmd/@sect/before}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
+   \xdef\c:secnumdepth{#2}\:Sc3%
+   \no at sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{\:Sc4#8\:Sc2}\HtmlEnv%
+   \UseHookWithArguments{cmd/@sect/after}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
+ }
 \let\:startsection\@startsection
 \def\@startsection#1{\@ifstar{\Configure{secType}{like#1}}%
    {\Configure{secType}{#1}}%
@@ -1366,6 +1376,7 @@
 \let\sv:Msect\M at sect
 \let\:Sc\:gobble
       \def\@sect##1##2##3##4##5##6[##7]##8{%
+   \UseHookWithArguments{cmd/@sect/before}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
    \ifx \o:@seccntformat:\:UnDef
   \let\o:@seccntformat:\@seccntformat
 \fi
@@ -1379,9 +1390,12 @@
 %
    \let\@seccntformat=\o:@seccntformat:
 %
-   \HtmlEnv    \Toc:Title{##7}\csname no:#1\endcsname{##8}}%
+   \HtmlEnv    \Toc:Title{##7}\csname no:#1\endcsname{##8}%
+   \UseHookWithArguments{cmd/@sect/after}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
+ }%
 %
       \def\@ssect##1##2##3##4##5{%
+   \UseHookWithArguments{cmd/@ssect/before}{5}{##1}{##2}{##3}{##4}{##5}%
    \gdef\ssect:ttl{##5}%
 %
    \let\@ssect\no at ssect
@@ -1390,7 +1404,9 @@
    \let\:Sc\sv:Sc \let\@sect\sv:sect \let\@ssect\sv:ssect
 \let\M at sect\sv:Msect
 %
-   \HtmlEnv   \csname :like#1\endcsname{##5}}%
+   \HtmlEnv   \csname :like#1\endcsname{##5}%
+   \UseHookWithArguments{cmd/@ssect/after}{5}{##1}{##2}{##3}{##4}{##5}%
+ }%
 \IgnorePar}
 \fi
 \pend:defI\@hangfrom{\a:@hangfrom}
@@ -2347,7 +2363,7 @@
 \expandafter\:temp\usepackage!*?: 
 \def\:tempa{\@latex at e@error}
 \ifx \:temp\:tempa
-   % latex209.4ht (2024-09-24-10:22), generated from tex4ht-4ht.tex
+   % latex209.4ht (2024-10-13-14:26), generated from tex4ht-4ht.tex
 % Copyright 1997-2009 Eitan M. Gurari
 % Copyright 2009-2024 TeX Users Group
 %
@@ -2366,7 +2382,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2024-09-24-10:22}
+\immediate\write-1{version 2024-10-13-14:26}
 
 \let\:fnsymbol\@fnsymbol
 \def\@fnsymbol#1{{\hbox{$\:fnsymbol{#1}$}}}



More information about the tex-live-commits mailing list.