[tex4ht-commits] [SCM] tex4ht updated: r1451 - trunk/lit

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Tue Jan 23 15:16:56 CET 2024


Author: michal_h21
Date: 2024-01-23 14:16:56 +0000 (Tue, 23 Jan 2024)
New Revision: 1451

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-sty.tex
Log:
protect :writetoc

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2024-01-22 21:33:00 UTC (rev 1450)
+++ trunk/lit/ChangeLog	2024-01-23 14:16:56 UTC (rev 1451)
@@ -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/lit/tex4ht-sty.tex
===================================================================
--- trunk/lit/tex4ht-sty.tex	2024-01-22 21:33:00 UTC (rev 1450)
+++ trunk/lit/tex4ht-sty.tex	2024-01-23 14:16:56 UTC (rev 1451)
@@ -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}



More information about the tex4ht-commits mailing list.