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

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Sat Mar 6 13:08:06 CET 2021


Author: michal_h21
Date: 2021-03-06 14:08:06 +0200 (Sat, 06 Mar 2021)
New Revision: 894

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
Log:
Prevent expansion of macros written to TOC by \caption

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2021-03-06 00:10:06 UTC (rev 893)
+++ trunk/lit/ChangeLog	2021-03-06 12:08:06 UTC (rev 894)
@@ -3,6 +3,9 @@
 	* tex4ht-sty.tex (tex4ht.sty): preparing for a new LaTeX release, where
 	\everypar will be patched by LaTeX kernel.
 	https://puszcza.gnu.org.ua/bugs/?477
+	* tex4ht-4ht.tex (caption.4ht): prevent expansion of macros written to TOC
+	by the \caption command.
+	https://tug.org/pipermail/tex4ht/2021q1/002912.html
 
 2021-03-04  Michal Hoftich  <michal.h21 at gmail.com>
 

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2021-03-06 00:10:06 UTC (rev 893)
+++ trunk/lit/tex4ht-4ht.tex	2021-03-06 12:08:06 UTC (rev 894)
@@ -11363,6 +11363,7 @@
 |<TeX4ht copyright|>
 |<caption shared config|>
 |<caption redefine makecaption|>
+|<caption addtocontents|>
 \Hinput{caption}
 \endinput
 >>>        \AddFile{9}{caption}
@@ -11434,7 +11435,17 @@
 }
 >>>
 
+Caption's version of addcontentsline doesn't prevent expansion of macros, which 
+may lead to errors when for example \''\%' is used. The use of detokenize should
+prevent this issue.
 
+\<caption addtocontents\><<<
+ \renewcommand*\caption@@@addcontentsline[4]{%
+   \addcontentsline{#1}{#2}{\protect\numberline{#3}{\detokenize{#4}}}%
+ }
+
+>>>
+
 %%%%%%%%%%%%%
 \Section{subcaption.sty}
 %%%%%%%%%%%%%



More information about the tex4ht-commits mailing list.