From d6888fdb49e3ac954c2d436951f364d3a4a4b17d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 22 Jun 2022 03:01:02 +0000 Subject: CTAN sync 202206220301 --- support/TeX4ht/source/ChangeLog | 6 ++++++ support/TeX4ht/source/tex4ht-4ht.tex | 30 ++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'support/TeX4ht') diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog index 5dfc905668..ef9c5510f6 100644 --- a/support/TeX4ht/source/ChangeLog +++ b/support/TeX4ht/source/ChangeLog @@ -1,3 +1,9 @@ +2022-06-21 Michal Hoftich + + * tex4ht-4ht.tex (latex.4ht): fixed support for \index commands + inside \caption. + https://tex.stackexchange.com/a/647924/2891 + 2022-06-20 Michal Hoftich * tex4ht-4ht.tex (pdfpages.4ht): added support for the Pdfpages diff --git a/support/TeX4ht/source/tex4ht-4ht.tex b/support/TeX4ht/source/tex4ht-4ht.tex index 0c2e94ba1b..0c2bd00913 100644 --- a/support/TeX4ht/source/tex4ht-4ht.tex +++ b/support/TeX4ht/source/tex4ht-4ht.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-4ht.tex 1157 2022-06-20 13:49:01Z michal_h21 $ +% $Id: tex4ht-4ht.tex 1158 2022-06-21 15:56:07Z michal_h21 $ % tex tex4ht-4ht or ht tex tex4ht-4ht % % Copyright 2009-2022 TeX Users Group @@ -11487,15 +11487,41 @@ The following has been changed for getting links in \`'.aux' files to \`'.lot' (list of tables) and \`'lof' (list of figures) files. \<<< +| \long\def\:tempc#1[#2]#3{\par \cur:lbl{}% |\begingroup + | \@parboxrestore \normalsize \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par - \endgroup |} + \endgroup +| +|} \def\numberline#1{\hbox to\@tempdima{#1\hfil} } \HLet\@caption|=\:tempc >>> +The index commands used inside caption may result in fatal error. +We use the LaTeX 3 sequences to save their contents inside caption, +and print them when it is safe. + +\<<< +\ExplSyntaxOn +\seq_new:N\:savedindex +\def\:initsaveindex{\seq_gclear:N\:savedindex} +\def\:saveindex#1{\seq_gput_right:Nn\:savedindex{#1}} +\def\:printsavedindex{\seq_map_inline:Nn\:savedindex{\index{##1}}} +\ExplSyntaxOff +>>> + +\<<< +\:initsaveindex% +\let\index\:saveindex% +>>> + +\<<< +\:printsavedindex% +>>> + The \''|' request no the \''\label' commands to avoid duplicating the anchor already set by the \''\caption' command. -- cgit v1.2.3