5. Making an index

The supplied macro file pca-ix.tmac creates a sorted index, with the aid of the external program makeindex. makeindex is included with TeX distributions, but you can also obtain just the makeindex distribution.

Note that the indexes created by groff and troff2page are necessarily different, because the respective paginations are different. In addition, the index generated for troff2page has the additional feature of hyperlinking to the appropriate locations in the body text.

The call

    .IX item

marks the text “item” as an indexable item. The metacharacters @, !, ", and | can be used to respectively specify (a) alternate alphabetization, (b) subitems, (c) literal metacharacters, and (d) encapsulation of the page number. Please see the makeindex documentation for all the details. Essentially, the syntax for entering index entries is the same as for LaTeX, except that in troff we use “.IX item” where in LaTeX one would use “\index{item}”.

pca-ix.tmac will call makeindex to create a sorted index in the auxiliary file \*[AUXF].ind, which can be slurped back into the input document:

    .so \*[AUXF].ind

Adding a section header on top is up to you.