texlive[69567] Master/texmf-dist: protect :writetoc, tex4ht r1451

commits+karl at tug.org commits+karl at tug.org
Tue Jan 23 22:58:54 CET 2024


Revision: 69567
          https://tug.org/svn/texlive?view=revision&revision=69567
Author:   karl
Date:     2024-01-23 22:58:54 +0100 (Tue, 23 Jan 2024)
Log Message:
-----------
protect :writetoc, tex4ht r1451

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

Modified Paths:
--------------
    trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
    trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex
    trunk/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2024-01-23 21:25:54 UTC (rev 69566)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2024-01-23 21:58:54 UTC (rev 69567)
@@ -1,3 +1,9 @@
+2024-01-23  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-sty.tex (tex4ht.sty): introduced \protected:edef as a
+	variant of \protected at edef, and used it in section definitions.
+	https://tex.stackexchange.com/q/707714/2891
+
 2024-01-22  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-docbook.tex (docbook.4ht): print reference number in the

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex	2024-01-23 21:25:54 UTC (rev 69566)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex	2024-01-23 21:58:54 UTC (rev 69567)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-sty.tex 1424 2023-12-14 09:55:08Z michal_h21 $
+% $Id: tex4ht-sty.tex 1451 2024-01-23 14:16:56Z michal_h21 $
 % tex tex4ht-sty   or   ht tex tex4ht-sty
 %
 % Copyright 2009-2022 TeX Users Group
@@ -5252,7 +5252,7 @@
 \escapechar=`\\%
 \protect:wrtoc
 \csname Modify#1ToToc\endcsname
-\edef\:writetoc{\csname if:toc\endcsname{\the\:tokwrite
+\protected:edef\:writetoc{\csname if:toc\endcsname{\the\:tokwrite
    {\string\doTocEntry
     \string\toc \expandafter\ifx\csname toToc:#1\endcsname\relax #1\else
        \csname toToc:#1\endcsname\fi
@@ -11132,7 +11132,20 @@
 
 LaTeX has \`'\def\@unexpandable at protect{\noexpand\protect\noexpand}' to be included in  immediate defines.
 
+This is a variant of \`'\protected at edef' from LaTeX. We cannot use it directly here, so I've made a copy.
 
+\<html utilities\><<<
+\def\:unexpand:protect{\noexpand\protect\noexpand}
+\def\:restore:protect{\let\protect\orig:protect}
+\def\protected:edef{%
+  \let\:orig:protect\protect%
+  \let\protect\:unexpand:protect%
+  \afterassignment\:restore:protect%
+  \edef%
+}
+
+>>>
+
 \Section{Tags}
 
 \SubSection{Html}

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty	2024-01-23 21:25:54 UTC (rev 69566)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty	2024-01-23 21:58:54 UTC (rev 69567)
@@ -1,8 +1,8 @@
 \ifnum\the\catcode`\%=14\else\expandafter\edef\csname
   \string:RestoreCatcodes\endcsname{\catcode`\%\the
   \catcode`\%}\catcode`\%14\fi
-% tex4ht.sty (2023-12-14-13:34), generated from tex4ht-sty.tex
-% Copyright 2009-2023 TeX Users Group
+% tex4ht.sty (2024-01-23-13:44), generated from tex4ht-sty.tex
+% Copyright 2009-2024 TeX Users Group
 % Copyright 1996-2009 Eitan M. Gurari
 %
 % This work may be distributed and/or modified under the
@@ -20,7 +20,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2023-12-14-13:34}
+\immediate\write-1{version 2024-01-23-13:44}
 
 
 \ifx  \Preamble\UnDef  \else
@@ -1277,6 +1277,15 @@
    \ifx \prOteCt\pr:tc    \let\prOteCt\relax
    \else \noexpand\Protect\expandafter\noexpand\fi
 }
+\def\:unexpand:protect{\noexpand\protect\noexpand}
+\def\:restore:protect{\let\protect\orig:protect}
+\def\protected:edef{%
+  \let\:orig:protect\protect%
+  \let\protect\:unexpand:protect%
+  \afterassignment\:restore:protect%
+  \edef%
+}
+
 \def\NewHaddr#1{\html:addr \let#1\last:haddr}
 \def\GetHref#1{\expandafter\get:href#1-}
 \def\GetHname#1{\expandafter\get:htag#1-}
@@ -2975,7 +2984,7 @@
    {\escapechar=`\\%
 \protect:wrtoc
 \csname Modify#1ToToc\endcsname
-\edef\:writetoc{\csname if:toc\endcsname{\the\:tokwrite
+\protected:edef\:writetoc{\csname if:toc\endcsname{\the\:tokwrite
    {\string\doTocEntry
     \string\toc \expandafter\ifx\csname toToc:#1\endcsname\relax #1\else
        \csname toToc:#1\endcsname\fi



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