texlive[65410] Master/texmf-dist: \\ in \caption, tex4ht r1280

commits+karl at tug.org commits+karl at tug.org
Sat Dec 31 00:46:37 CET 2022


Revision: 65410
          http://tug.org/svn/texlive?view=revision&revision=65410
Author:   karl
Date:     2022-12-31 00:46:36 +0100 (Sat, 31 Dec 2022)
Log Message:
-----------
\\ in \caption, tex4ht r1280

Revision Links:
--------------
    http://tug.org/svn/texlive?view=revision&revision=1280

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

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2022-12-30 21:55:05 UTC (rev 65409)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2022-12-30 23:46:36 UTC (rev 65410)
@@ -1,3 +1,8 @@
+2022-12-30  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (nameref.4ht): fixed support for \\ in \caption.
+	https://tex.stackexchange.com/a/670159/2891
+
 2022-12-27  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): fixed use of \left and

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2022-12-30 21:55:05 UTC (rev 65409)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2022-12-30 23:46:36 UTC (rev 65410)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1278 2022-12-26 19:24:35Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1280 2022-12-30 23:31:42Z michal_h21 $
 % tex tex4ht-4ht   or   ht tex tex4ht-4ht
 %
 % Copyright 2009-2022 TeX Users Group    
@@ -3499,11 +3499,23 @@
 %   
 % use of \index and \label inside caption results in a fatal error
 % we need to disable them in \NR:Title
+
+% there can be more problematic commands, so we provide a configuration
+% that can be used multiple times - the default value fixes known commands
+% but a user can add more of them
+
+\def\a:captioncommandsfix{}
+\NewConfigure{CaptionCommandsFix}[1]{\concat:config\a:captioncommandsfix{#1}}
+\Configure{CaptionCommandsFix}{
+  \let\index\:gobble%
+  \let\label\:gobble%
+  \let\\\relax% causes issues when \centering is active
+}
+
 \long\def\@caption#1[#2]{%
     \gdef\NR:Type{\@currenvir}%
     \begingroup%
-    \let\index\:gobble%
-    \let\label\:gobble%
+    \a:captioncommandsfix
     \protected at xdef\NR:Title{\a:newlabel{#2}}%
     \endgroup%
    \o:NR@@caption{#1}[{#2}]%
@@ -3552,8 +3564,7 @@
     % handle \label and \index in Caption's package
     % version of \caption
     \begingroup%
-    \let\index\:gobble%
-    \let\label\:gobble%
+    \a:captioncommandsfix
     \protected at xdef\NR:Title{\a:newlabel{##2}}%
     \endgroup%
   }

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/nameref.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/nameref.4ht	2022-12-30 21:55:05 UTC (rev 65409)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/nameref.4ht	2022-12-30 23:46:36 UTC (rev 65410)
@@ -1,4 +1,4 @@
-% nameref.4ht (2022-11-21-13:02), generated from tex4ht-4ht.tex
+% nameref.4ht (2022-12-30-15:46), generated from tex4ht-4ht.tex
 % Copyright 2005-2009 Eitan M. Gurari
 % Copyright 2009-2022 TeX Users Group
 %
@@ -17,7 +17,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2022-11-21-13:02}
+\immediate\write-1{version 2022-12-30-15:46}
 
    \let\NR:Type\relax
 \let\ltx at label\label
@@ -88,11 +88,23 @@
 %
 % use of \index and \label inside caption results in a fatal error
 % we need to disable them in \NR:Title
+
+% there can be more problematic commands, so we provide a configuration
+% that can be used multiple times - the default value fixes known commands
+% but a user can add more of them
+
+\def\a:captioncommandsfix{}
+\NewConfigure{CaptionCommandsFix}[1]{\concat:config\a:captioncommandsfix{#1}}
+\Configure{CaptionCommandsFix}{
+  \let\index\:gobble%
+  \let\label\:gobble%
+  \let\\\relax% causes issues when \centering is active
+}
+
 \long\def\@caption#1[#2]{%
     \gdef\NR:Type{\@currenvir}%
     \begingroup%
-    \let\index\:gobble%
-    \let\label\:gobble%
+    \a:captioncommandsfix
     \protected at xdef\NR:Title{\a:newlabel{#2}}%
     \endgroup%
    \o:NR@@caption{#1}[{#2}]%
@@ -141,8 +153,7 @@
     % handle \label and \index in Caption's package
     % version of \caption
     \begingroup%
-    \let\index\:gobble%
-    \let\label\:gobble%
+    \a:captioncommandsfix
     \protected at xdef\NR:Title{\a:newlabel{##2}}%
     \endgroup%
   }



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