An index is similar to a table of contents, in that entry labels and
locations must be collected, but poses a greater challenge because it
needs to be sorted before it is output. Here, processing the document
in multiple passes is inescapable, and tools like the makeindex
program are necessary.