[tex4ht] imakeidx weirdness with numbered entries

Jürgen Hubert jhubert at gmx.de
Sun Mar 2 06:52:15 CET 2025


I've encountered some strange behavior while using imakeidx. In my work, I use several indices - including one with years. Here is a shortened example:


https://drive.google.com/drive/folders/1u1X2_W06yxG002fNFT_yqTofD0iSEn5R?usp=sharing

The main file is "EPUBTest.tex". I compile it with

tex4ebook -c myconfig.cfg -e mybuild.mk4 -e mybuild.lua -m index EPUBTest.tex

tex4ebook -e mybuild.mk4 -m index EPUBTest.tex



Here is the relevant part:

----------------

This is the year 3 AD.\index[time]{01st century!3}

This is the year 2 AD.\index[time]{01st century!2}

This is the year 1 AD.\index[time]{01st century!1}

This is the year 23 AD.\index[time]{01st century!23}

This is the year 22 AD.\index[time]{01st century!22}

This is the year 21 AD.\index[time]{01st century!21}

----------------

The output for the "Timeline" index is in EPUBTestli4.html

01st century
    - 1, 3
    - 21, 6
    - 2
    - 22, 5
    - 23, 4
    - 3, 1

Strangely enough, the index entries with a single digit integrate a link to a location in the main text, while the ones with two digits do not. I.e. with

    - 1, 3

both "1" and "3" have links (to different locations!)

while with

    - 21, 6

only "6" has a link.

And the

    - 2

only has a single link within the "2".


This kind of problem only seems to show up with index entries that start with numbers. Does anyone know what causes this, and if so how to prevent it?


Best regards,

- Jürgen Hubert




More information about the tex4ht mailing list.