Skip to main content

Section 23.4 Index entries

PreTeXt does a good job of supporting index generation. You still need to tag everything that should get an index entry by hand, but then the index is produced automatically. For a simple index entry for the word “group”, you just use <idx>group<idx>. If you need an index entry involving subheadings, such as “normal” under “subgroup”, use <idx><h>subgroup</h><h>normal</h><idx>.

It is also possible to use “see” and “see also” entries for indices. For instance, in Chapter 12, we use

<idx><h>font</h><see>formatting</see></idx>

to create an index entry for “font” that instructs the reader to “see formatting”. A “see also” can be created using the <seealso> tag instead of <see>.

If the index entry is in danger of being alphabetized incorrectly, you can specify how it should be sorted with the @sortby attribute. For example, to give an index entry to \(\Sigma\) in the “s” section, you would use <idx sortby="sigma"><m>\Sigma</m></idx>. Note that if the index entry has <h> tags, the @sortby attribute should go there, not on <idx>.

If you generate PDF output from , the index is automatically generated.