diff options
author | Karl Berry <karl@freefriends.org> | 2022-06-21 21:07:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-06-21 21:07:31 +0000 |
commit | 78e3794b2c03db3679b6cc937667189d300afa91 (patch) | |
tree | 143020e97f60e2f831729d1893df7973049f2cd0 /Master/texmf-dist | |
parent | 30015ed56b95dd3a90998697dbf10ba53b6332d6 (diff) |
\index inside \caption, tex4ht r1158
git-svn-id: svn://tug.org/texlive/trunk@63684 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/source/generic/tex4ht/ChangeLog | 6 | ||||
-rw-r--r-- | Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex | 30 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/tex4ht/latex.4ht | 23 |
3 files changed, 52 insertions, 7 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog index 5dfc905668e..ef9c5510f62 100644 --- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog +++ b/Master/texmf-dist/source/generic/tex4ht/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/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex index 0c2e94ba1b7..0c2bd009132 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 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. diff --git a/Master/texmf-dist/tex/generic/tex4ht/latex.4ht b/Master/texmf-dist/tex/generic/tex4ht/latex.4ht index 009e7c64698..e11d41562f9 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/latex.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/latex.4ht @@ -1,4 +1,4 @@ -% latex.4ht (2022-06-09-13:58), generated from tex4ht-4ht.tex +% latex.4ht (2022-06-21-13:58), generated from tex4ht-4ht.tex % Copyright 1997-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-06-09-13:58} +\immediate\write-1{version 2022-06-21-13:58} \ifx\SaveMkHalignConf:g\:UnDef \else \expandafter\endinput\fi @@ -1412,6 +1412,13 @@ $\vcenter \def\af:float{#4}} \gHAssign\capt:cnt0 \Configure{float}{}{}{} +\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 + \long\def\:tempc#1[#2]#3{\par \cur:lbl{}% \begingroup \gHAdvance\TitleCount by 1 @@ -1427,9 +1434,15 @@ $\vcenter {#1}\relax}}\:temp \endgroup \begingroup + \:initsaveindex% +\let\index\:saveindex% + \@parboxrestore \normalsize \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par - \endgroup \let\skip:anchor\:UnDef + \endgroup +\:printsavedindex% + +\let\skip:anchor\:UnDef } \def\numberline#1{\hbox to\@tempdima{#1\hfil} } \HLet\@caption\:tempc @@ -2309,7 +2322,7 @@ $\vcenter \expandafter\:temp\usepackage!*?: \def\:tempa{\@latex@e@error} \ifx \:temp\:tempa - % latex209.4ht (2022-06-09-13:58), generated from tex4ht-4ht.tex + % latex209.4ht (2022-06-21-13:58), generated from tex4ht-4ht.tex % Copyright 1997-2009 Eitan M. Gurari % Copyright 2009-2022 TeX Users Group % @@ -2328,7 +2341,7 @@ $\vcenter % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2022-06-09-13:58} +\immediate\write-1{version 2022-06-21-13:58} \let\:fnsymbol\@fnsymbol \def\@fnsymbol#1{{\hbox{$\:fnsymbol{#1}$}}} |