texlive[73076] Master/texmf-dist: indexhaddr config and sec-index
commits+karl at tug.org
commits+karl at tug.org
Sun Dec 8 23:21:55 CET 2024
Revision: 73076
https://tug.org/svn/texlive?view=revision&revision=73076
Author: karl
Date: 2024-12-08 23:21:54 +0100 (Sun, 08 Dec 2024)
Log Message:
-----------
indexhaddr config and sec-index option, tex4ht r1615
Revision Links:
--------------
https://tug.org/svn/texlive?view=revision&revision=1615
Modified Paths:
--------------
trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
trunk/Master/texmf-dist/tex/generic/tex4ht/imakeidx.4ht
trunk/Master/texmf-dist/tex/generic/tex4ht/latex.4ht
trunk/Master/texmf-dist/tex/generic/tex4ht/multind.4ht
trunk/Master/texmf-dist/tex/generic/tex4ht/splitidx.4ht
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2024-12-08 21:52:55 UTC (rev 73075)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2024-12-08 22:21:54 UTC (rev 73076)
@@ -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/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex 2024-12-08 21:52:55 UTC (rev 73075)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex 2024-12-08 22:21:54 UTC (rev 73076)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1614 2024-12-08 15:56:49Z karl $
+% $Id: tex4ht-4ht.tex 1615 2024-12-08 22:14:41Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2024 TeX Users Group
@@ -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}
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/imakeidx.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/imakeidx.4ht 2024-12-08 21:52:55 UTC (rev 73075)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/imakeidx.4ht 2024-12-08 22:21:54 UTC (rev 73076)
@@ -1,4 +1,4 @@
-% imakeidx.4ht (2024-05-22-14:13), generated from tex4ht-4ht.tex
+% imakeidx.4ht (2024-12-08-14:21), generated from tex4ht-4ht.tex
% Copyright 2019-2024 TeX Users Group
%
% This work may be distributed and/or modified under the
@@ -16,14 +16,14 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2024-05-22-14:13}
+\immediate\write-1{version 2024-12-08-14:21}
\def\:temp#1#2#3{\html:addr%
-\hbox{\Link-{}{dx\last:haddr
+\hbox{\Link-{}{\a:indexhaddr
}\EndLink}%
\expandafter\protected at write\csname#1 at idxfile\endcsname{}%
-{\string\beforeentry{\RefFileNumber\FileNumber}{dx\last:haddr
+{\string\beforeentry{\RefFileNumber\FileNumber}{\a:indexhaddr
}{\a:makeindex}}%
\o:imki at wrindexentrysplit:{#1}{#2}{#3}%
}
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/latex.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/latex.4ht 2024-12-08 21:52:55 UTC (rev 73075)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/latex.4ht 2024-12-08 22:21:54 UTC (rev 73076)
@@ -1,4 +1,4 @@
-% latex.4ht (2024-12-06-14:38), generated from tex4ht-4ht.tex
+% latex.4ht (2024-12-08-14:21), generated from tex4ht-4ht.tex
% Copyright 1997-2009 Eitan M. Gurari
% Copyright 2009-2024 TeX Users Group
%
@@ -17,7 +17,7 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2024-12-06-14:38}
+\immediate\write-1{version 2024-12-08-14:21}
\ifx\SaveMkHalignConf:g\:UnDef \else \expandafter\endinput\fi
@@ -1659,10 +1659,10 @@
\def\@wrglossary{\:wribefr\@glossaryfile\:wrglossary}
\fi
\def\:wribefr#1{\title:chs{\html:addr
- \hbox{\Link-{}{dx\last:haddr
+ \hbox{\Link-{}{\a:indexhaddr
}\EndLink}}{}%
\edef\:temp{\write#1{\expandafter\string\a:idxmake{\RefFileNumber
- \FileNumber}{\title:chs {dx\last:haddr
+ \FileNumber}{\title:chs {\a:indexhaddr
}{\cur:th
\:currentlabel}}{\a:makeindex}}}\:temp}
\ifx \a:makeindex\:UnDef
@@ -1671,6 +1671,30 @@
\ifx \beforeentry\:UnDef \def\beforeentry#1#2{} \fi
\NewConfigure{idxmake}{1}
\Configure{idxmake}{\beforeentry}
+\NewConfigure{indexhaddr}{1}
+\Configure{indexhaddr}{dx\last:haddr}
+\: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
\:CheckOption{no-bib} \if:Option\else
\ifx \o:@citex:\:UnDef \let\o:@citex:\@citex\fi
@@ -2379,7 +2403,7 @@
\expandafter\:temp\usepackage!*?:
\def\:tempa{\@latex at e@error}
\ifx \:temp\:tempa
- % latex209.4ht (2024-12-06-14:38), generated from tex4ht-4ht.tex
+ % latex209.4ht (2024-12-08-14:21), generated from tex4ht-4ht.tex
% Copyright 1997-2009 Eitan M. Gurari
% Copyright 2009-2024 TeX Users Group
%
@@ -2398,7 +2422,7 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2024-12-06-14:38}
+\immediate\write-1{version 2024-12-08-14:21}
\let\:fnsymbol\@fnsymbol
\def\@fnsymbol#1{{\hbox{$\:fnsymbol{#1}$}}}
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/multind.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/multind.4ht 2024-12-08 21:52:55 UTC (rev 73075)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/multind.4ht 2024-12-08 22:21:54 UTC (rev 73076)
@@ -1,39 +1,31 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% multind.4ht 2009-05-21-09:32 %
-% Copyright (C) 1999--2009 Eitan M. Gurari %
-% %
-% This work may be distributed and/or modified under the %
-% conditions of the LaTeX Project Public License, either %
-% version 1.3c of this license or (at your option) any %
-% later version. The latest version of this license is %
-% in %
-% http://www.latex-project.org/lppl.txt %
-% and version 1.3c or later is part of all distributions %
-% of LaTeX version 2005/12/01 or later. %
-% %
-% This work has the LPPL maintenance status "maintained".%
-% %
-% This Current Maintainer of this work %
-% is Eitan M. Gurari. %
-% %
-% If you modify this program your changing its signature %
-% with a directive of the following form will be %
-% appreciated. %
-% \message{signature} %
-% %
-% gurari at cse.ohio-state.edu %
-% http://www.cse.ohio-state.edu/~gurari %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\immediate\write-1{version 2009-05-21-09:32}
+% multind.4ht 2024-12-08-14:21 %
+% Copyright (C) 1999-2009 Eitan M. Gurari %
+% Copyright 2009-2024 TeX Users Group
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3c of this license or (at your option) any
+% later version. The latest version of this license is in
+% https://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions
+% of LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work
+% is the TeX4ht Project <https://tug.org/tex4ht>.
+%
+% If you modify this program, changing the
+% version identification would be appreciated.
-
\pend:defII\@wrindex{\warn:idx{##1}\@ifundefined{##1 at idxfile}{}{\html:addr
- \hbox{\Link-{}{dx\last:haddr
+ \hbox{\Link-{}{\a:indexhaddr
}\EndLink}%
\edef\:temp{\expandafter
\write\csname ##1 at idxfile\endcsname{\string
\beforeentry{\RefFileNumber
- \FileNumber}{dx\last:haddr
+ \FileNumber}{\a:indexhaddr
}{\a:makeindex}}}\:temp
}}
\ifx \a:makeindex\:UnDef
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/splitidx.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/splitidx.4ht 2024-12-08 21:52:55 UTC (rev 73075)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/splitidx.4ht 2024-12-08 22:21:54 UTC (rev 73076)
@@ -1,31 +1,23 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% splitidx.4ht 2009-05-21-09:32 %
-% Copyright (C) 2003--2009 Eitan M. Gurari %
-% %
-% This work may be distributed and/or modified under the %
-% conditions of the LaTeX Project Public License, either %
-% version 1.3c of this license or (at your option) any %
-% later version. The latest version of this license is %
-% in %
-% http://www.latex-project.org/lppl.txt %
-% and version 1.3c or later is part of all distributions %
-% of LaTeX version 2005/12/01 or later. %
-% %
-% This work has the LPPL maintenance status "maintained".%
-% %
-% This Current Maintainer of this work %
-% is Eitan M. Gurari. %
-% %
-% If you modify this program your changing its signature %
-% with a directive of the following form will be %
-% appreciated. %
-% \message{signature} %
-% %
-% gurari at cse.ohio-state.edu %
-% http://www.cse.ohio-state.edu/~gurari %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\immediate\write-1{version 2009-05-21-09:32}
-
+% splitidx.4ht 2024-12-08-14:21 %
+% Copyright (C) 2003-2009 Eitan M. Gurari %
+% Copyright 2009-2024 TeX Users Group
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3c of this license or (at your option) any
+% later version. The latest version of this license is in
+% https://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions
+% of LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work
+% is the TeX4ht Project <https://tug.org/tex4ht>.
+%
+% If you modify this program, changing the
+% version identification would be appreciated.
\def\warn:idx#1{%
\expandafter\ifx \csname #1warn:idx\endcsname\relax
\expandafter\global
@@ -46,20 +38,20 @@
\if at splitidx
\warn:idx{##1}%
\@ifundefined{@indexfile@##1}{}{\html:addr
- \hbox{\Link-{}{dx\last:haddr
+ \hbox{\Link-{}{\a:indexhaddr
}\EndLink}%
\edef\:temp{\expandafter
\write\csname @indexfile@##1\endcsname{\expandafter
\string\a:idxmake{\RefFileNumber
- \FileNumber}{dx\last:haddr
+ \FileNumber}{\a:indexhaddr
}{\a:makeindex}}}\:temp}%
\else
\warn:idx{\jobname}%
- \html:addr \hbox{\Link-{}{dx\last:haddr
+ \html:addr \hbox{\Link-{}{\a:indexhaddr
}\EndLink
\edef\:temp{%
\write\@indexfile{\expandafter\string\a:idxmake{\RefFileNumber
- \FileNumber}{dx\last:haddr
+ \FileNumber}{\a:indexhaddr
}{\a:makeindex}}}\:temp}%
\fi
}
More information about the tex-live-commits
mailing list.