diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-23 21:58:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-23 21:58:54 +0000 |
commit | 658f190359e3f1d5023e9d61ebfaddecb4ea41d8 (patch) | |
tree | 5a77e541731c361f2b62865710b51ea2885a696d /Master | |
parent | 9e5e57a40ed20d36034d87d882b8e0ad3bf7e6f9 (diff) |
protect :writetoc, tex4ht r1451
git-svn-id: svn://tug.org/texlive/trunk@69567 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/source/generic/tex4ht/ChangeLog | 6 | ||||
-rw-r--r-- | Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex | 17 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty | 17 |
3 files changed, 34 insertions, 6 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog index eee6684fc10..2d9c40eaf8f 100644 --- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog +++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog @@ -1,3 +1,9 @@ +2024-01-23 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-sty.tex (tex4ht.sty): introduced \protected:edef as a + variant of \protected@edef, and used it in section definitions. + https://tex.stackexchange.com/q/707714/2891 + 2024-01-22 Michal Hoftich <michal.h21@gmail.com> * tex4ht-docbook.tex (docbook.4ht): print reference number in the diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex index e8464d47b1e..34435a78243 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-sty.tex @@ -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 @@ when the command is encountered. \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,6 +11132,19 @@ titles of sections are referenced. LaTeX has \`'\def\@unexpandable@protect{\noexpand\protect\noexpand}' to be included in immediate defines. +This is a variant of \`'\protected@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} diff --git a/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty b/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty index 250be9467ad..c0cdadf2f27 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty +++ b/Master/texmf-dist/tex/generic/tex4ht/tex4ht.sty @@ -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 |