Skip to main content
Display Word-generated document indexes with alphabetical term listings. Document indexes imported from Word render as block elements containing the original index entries. Index entry markers (invisible inline nodes) mark terms throughout the document for inclusion in the index.
Document indexes and index entries are managed automatically during Word document import and export. There are no commands to programmatically create or update indexes.

How it works

The document index system consists of two node types:
  • Index block — A block node that contains the rendered index (alphabetical listing of terms with page references)
  • Index entry — An invisible inline marker placed throughout the document text to mark terms for inclusion in the index

Word export

Indexes export as Word field codes:
<!-- Index block -->
<w:p>
  <w:r><w:fldChar w:fldCharType="begin"/></w:r>
  <w:r><w:instrText>INDEX \l "1"</w:instrText></w:r>
  <w:r><w:fldChar w:fldCharType="end"/></w:r>
</w:p>

<!-- Index entry marker -->
<w:r>
  <w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r>
  <w:instrText> XE "Primary Entry" </w:instrText>
</w:r>
<w:r>
  <w:fldChar w:fldCharType="end"/>
</w:r>

Source code