[tex4ht-commits] [SCM] tex4ht updated: r1615 - trunk/lit

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Sun Dec 8 23:14:42 CET 2024


Author: michal_h21
Date: 2024-12-08 22:14:41 +0000 (Sun, 08 Dec 2024)
New Revision: 1615

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
Log:
Added indexhaddr configuration and sec-index option

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2024-12-08 15:56:49 UTC (rev 1614)
+++ trunk/lit/ChangeLog	2024-12-08 22:14:41 UTC (rev 1615)
@@ -1,3 +1,10 @@
+2024-12-08  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (
+	latex.4ht, imakeidx.4ht, splitidx.4ht, multind.4ht
+	): added the indexhaddr configuration and sec-index option.
+	https://tex.stackexchange.com/a/732446/2891
+
 2024-12-08  Karl Berry  <karl at freefriends.org>
 
 	* tex4ht-4ht.tex (IEEEtran.4ht): |<TeX4ht copywrite|> to

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2024-12-08 15:56:49 UTC (rev 1614)
+++ trunk/lit/tex4ht-4ht.tex	2024-12-08 22:14:41 UTC (rev 1615)
@@ -13372,6 +13372,51 @@
 \end{document}  
 \EndVerbatim
 
+
+This is the ID created by the \''\index' commands in the document. 
+They can be used to point to that place from the index.
+
+\<latex ltidxglo\><<<
+\NewConfigure{indexhaddr}{1}
+\Configure{indexhaddr}{d|<haddr prefix|>\last:haddr}
+>>>
+
+This placeholder is used by various packages that define \''\index' and 
+its variants.
+
+\<index haddr\><<<
+\a:indexhaddr
+>>>
+
+The sec-index option can be used to use current sections as numbers and destinations 
+for the index, instead of the actual positions of \''\index' commands. 
+
+\<latex ltidxglo\><<<
+\:CheckOption{sec-index}\if:Option
+
+% from https://tex.stackexchange.com/a/141369/2891
+% for some reason it fails if the command includes :, so I use FourHT prefix to avoid collisions
+\newcommand{\FourHTgetCurrentSectionNumber}{%
+  \ifnum\c at section=0 %
+  \thechapter
+  \else
+  \ifnum\c at subsection=0 %
+  \thesection
+  \else
+  \ifnum\c at subsubsection=0 %
+  \thesubsection
+  \else
+  \thesubsubsection
+  \fi
+  \fi
+  \fi
+}
+\Configure{makeindex}{\FourHTgetCurrentSectionNumber}%
+\Configure{indexhaddr}{\CurSecHaddr}%
+\fi
+>>>
+
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%
 \Section{theindex}
 %%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -33351,9 +33396,6 @@
 \PassOptionsToPackage{noautomatic}{imakeidx}
 >>> \AddFile{9}{imakeidx-hooks}
 
-\<index haddr\><<<
-d|<haddr prefix|>\last:haddr
->>>
 
 %%%%%%%%%%%%%%%%%%%%%%%%
 \SubSection{indextools.sty}



More information about the tex4ht-commits mailing list.