Automatic Indexing with the DocBook DSSSL Stylesheets

Norman Walsh

17 Nov 1998


Authoring for Indexing

There are two parts to building an index automatically, creating the index terms and incorporating the generated index into your document.

Creating an Index

Creating an index is a multi-step, two-pass process:

Drawbacks

Any generated index is perhaps better than none, but there are still a few things that cannot be accomplished:

  1. Duplicate page numbers are not suppressed in the index. If the document contains three indexing hits on page 4, the generated index will contain “4, 4, 4”.

  2. Ranges are not automatically constructed. If the document contains indexing hits on pages 4, 5, 6, and 7, the generated index will contain “4, 5, 6, 7” instead of “4–7”.

It is possible that the TeX backend could be made smart enough to do these things automatically. (Sebastian will probably kill me for suggesting that). For the RTF backend, at least in MS Word, it's probably possible to write a WordBasic macro that would automatically fix the index. (If someone does, please pass it along).