Introduction
Ideally, all index tags will end up between <PARA> and </PARA> tags.
However, the goal of using indexing tags is to get accurate page
numbers in the final index with a minimum of effort.
Constraining the index tags to remain within tags leads to
inaccuracy. Worse than that, index tags can mess up the book format,
creating problems ranging from missing text and altered font styles to
misaligned tables, new page breaks, and occasionally fatal errors.
Why are index tags such a problem? Here's my theory. When the document is
being analyzed (parsed) and the opening index tag is discovered, the parser
"learns" a few things. First, text that follows <INDEXTERM> is not to show up in the document. Second, that the text before the <INDEXTERM> tag and after the </INDEXTERM> tag should be formatted as if the index tags and contents had never been there. Unfortunately, I have found that this second item is not handled for <INDEXTERM> in the same way that it is handled for other tags, such as <EMPHASIS> and <MONOSPACED> tags.
When a start-tag is located, no matter what start-tag it is (except index tags,
because they are different), the parser alters the "format conditions" that exist for the text in front of the tag. For example, the format conditions of all the text in this paragraph so far is "plain" or "Roman." (Actually, it's whatever the default text for your HTML browser is, but for me, it's just plain ordinary Roman text.) Each tag in this paragraph, however, would augment these format conditions, and how it augments them depends on what tag it is. For example, in sgml, an <EMPHASIS> tag simply "adds" the trait of emphasis to whatever text format immediately preceded that tag. When the </EMPHASIS> appears, the trait of emphasis is "subtracted" from the text style. This allows for tag embedding. Simply by stringing together a whole bunch of tags, it's possible to take ordinary text and add several formatting features, such as small caps, boldface, and italics. These traits can then be removed in any order.
The problem is that there really is no such thing as an "index trait." In order for the parser to react properly to an index tag, the formatting information and further instructions have to be hardcoded. Whereas all tags are otherwise relative -- adding and subtracting traits to whatever preceeded the tag -- the index tag sets a new format for the index tag text and then "resets" the text. Unfortunately, it will automatically reset the text to "plain old Roman text," or whatever is default. In other words, putting in an <INDEXTERM> tag pair is the same as reseting the text to a default condition.
This means that an index term can never appear anywhere where the text immediately following it must be something other than plain old Roman text. It is for this reason that all the examples that follow are unacceptable.