About Arbortext Styler > Generating Indexes > Including Elements not Styled as Index Terms in an Index
  
Including Elements not Styled as Index Terms in an Index
You can include elements that do not have an Index Term (Model) style in an index. For example, you may wish to see chapter titles in your index. A summary of the process is given below (the process assumes that index terms are configured to the Element Model):
1. In Arbortext Styler, select the context that you wish to see in an index, for example title in chapter.
2. In the Generated text category for the context, add generated text before element content.
3. In the Generated Text Editor, choose Insert > Markup. Insert the relevant index term element, for example indexterm.
4. In the primary index term element, choose Insert > Element Content. Accept the default settings for Current Element. Exit the Generated Text Editor.
5. Preview your document. You will see that chapter titles are included in your index, as well as index terms from the body of the document.
Alternatively, you could insert a UFE into the generated text of the title in chapter context. Give the UFE the Index Term (Element Model) style then insert the UFE(s) into the title’s generated text as detailed below:
Insert a UFE with a child UFE that represents the level 1 index term.
To complete the index term model insert child UFEs representing level 2, level 3, see, and see-also index terms.
If you have a sort key, you can use the Attribute Modifier in the generated text editor to set an attribute in any of the index term UFEs.
Conditional Inclusion of an Index Term in an Index
To include index terms in an index only when a specific condition matches, configure index terms in a slightly different way. For example, you may want to include a chapter title as an index term when the chapter is in Spanish. Note that this example assumes the use of the Element Model for index terms:
1. Create a UFE that will represent the main index term, for example _ufe:indexterm. Give it the Index Term (Element Model) style. Configure the roles for the index term elements in your document type, for example primary and secondary. Associate the UFE with the required index definition object.
2. Style the index term elements used in your document type as Inline. For example, style indexterm, primary, and secondary in this way.
3. Set the child index term elements, for example primary and secondary, to be Hidden in output.
4. Create the contexts and/or conditions where the element is to be included in an index. For example, title in chapter IF attribute “xml:lang”of parent element = ”es”.
5. For contexts or conditions that are to be included as index terms, for example title in chapter IF attribute “xml:lang”of parent element = ”es”, configure the generated text to insert the UFE that represents the main index term before element content, for example _ufe:indexterm.
In the UFE, insert child index term elements, for example primary and secondary, and set them to insert content as required.