summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-12-30 23:46:36 +0000
committerKarl Berry <karl@freefriends.org>2022-12-30 23:46:36 +0000
commit67b7f1ecb6dce63c006dfca50de45245364f1e8c (patch)
treedafacfe9b7e2cf4c46a9876eab3e3aeab3b5a694 /Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
parent25fb543f397c304fd4259f4cce8956629561e822 (diff)
\\ in \caption, tex4ht r1280
git-svn-id: svn://tug.org/texlive/trunk@65410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex')
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex21
1 files changed, 16 insertions, 5 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
index d57d1e294c0..8a63480c63c 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
@@ -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 @@ definitions.
%
% 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@xdef\NR:Title{\a:newlabel{#2}}%
\endgroup%
\o:NR@@caption{#1}[{#2}]%
@@ -3552,8 +3564,7 @@ definitions.
% handle \label and \index in Caption's package
% version of \caption
\begingroup%
- \let\index\:gobble%
- \let\label\:gobble%
+ \a:captioncommandsfix
\protected@xdef\NR:Title{\a:newlabel{##2}}%
\endgroup%
}