diff options
author | Norbert Preining <norbert@preining.info> | 2022-06-22 03:01:02 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-06-22 03:01:02 +0000 |
commit | d6888fdb49e3ac954c2d436951f364d3a4a4b17d (patch) | |
tree | 6afde4b28d9150c5e111b3319fc5c475b8fd502c /support/TeX4ht | |
parent | 884ebedeec6018feff488351eff936cf5b56c030 (diff) |
CTAN sync 202206220301
Diffstat (limited to 'support/TeX4ht')
-rw-r--r-- | support/TeX4ht/source/ChangeLog | 6 | ||||
-rw-r--r-- | support/TeX4ht/source/tex4ht-4ht.tex | 30 |
2 files changed, 34 insertions, 2 deletions
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 <michal.h21@gmail.com> + + * tex4ht-4ht.tex (latex.4ht): fixed support for \index commands + inside \caption. + https://tex.stackexchange.com/a/647924/2891 + 2022-06-20 Michal Hoftich <michal.h21@gmail.com> * 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. \<latex ltfloat\><<< +|<latex caption index|> \long\def\:tempc#1[#2]#3{\par \cur:lbl{}% |<write caption to toc|>\begingroup + |<latex caption index save|> \@parboxrestore \normalsize \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par - \endgroup |<cancel if-label anchors|>} + \endgroup +|<latex caption index print|> +|<cancel if-label anchors|>} \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. + +\<latex caption index\><<< +\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 +>>> + +\<latex caption index save\><<< +\:initsaveindex% +\let\index\:saveindex% +>>> + +\<latex caption index print\><<< +\:printsavedindex% +>>> + The \''|<cancel if-label anchors|>' request no the \''\label' commands to avoid duplicating the anchor already set by the \''\caption' command. |