Embedded Indexing

Using markup within the Well-Formed Document Workflow to embed index terms in documents makes it possible to index a title once and have the topical boundaries saved in the file. This information travels through the Hub to IDTT. In the case that a title needs to be redesigned or is published in a large print edition at a later time, the same indexing work is still available and the print index can be regenerated from the location of the embedded indexed terms.


In a traditional publishing workflow, indexing is one of the last steps completed during production. For the indexer to work, the entire project must be typset and finalized. If any late changes cause the pagination to change, the work typically must be reindexed.

This procedure describes how to embed index terms in Word and how to use the corresponding Scribe Tools in InDesign to generate the print index. Recent versions of Scribe Tools will also export this index data, however the information is not currently used directly by e-readers. This procedure does not explain how to create a successful index with useful terms and cross references; an experienced indexer should use the tools in the SAI to index the work. The WFDW can typically handle the basic formatting and alphabetization. A final review of the typeset index by an indexer or copyeditor is recommended to address any improperly ordered index entries.

Indexing Support

Certain features of standard indexes are not available currently with this process. Consider this list while determining whether this process will be efficient and useful for your project. Some of these are limitations of either Word or InDesign and are unlikely to be expanded within ScML as round-tripping would be “lossy.” Others may move from unsupported to supported in the future.


  • Index entries with up to three subentries.
  • Sorting based on some text other than the main entry.
  • Page spans.
  • Bold or italic page numbers (e.g., to indicate an index entry on a page with a relevant graphic).
  • Character styles within index entries.
  • Sees and see alsos.
  • Multiple indexes within the same file (currently requires manual workarounds).


  • Index entries in notes being labeled with the note number.
  • Custom sorting of subentries.


  • InDesign and Word do not necessarily alphabetize using the same rules (particularly when it comes to sorting numbers). It is preferable to defer to the software’s alphabetization rules when possible, but in cases where a specific sort is required, do not assume that what you see in Word will be identical to what you see in InDesign. Do a test flow if sort order is very important.
  • This process cannot occur outside of the workflow. Do not attempt to set up an ScML file while at the same time typesetting the book in order to merge the index in later. The workflow requires that the IDTT be generated from the ScML that includes the idx tags.

Understanding the Markup

<idx> entries have a callout form that is used in .docx files and an XML form used in .sam/.scml files.

This term will be indexed to whatever page the <idx/> tag ends up on.

  • Word: { XE "Lincoln, Abraham" }
  • XML: <idx term="Lincoln, Abraham"/>

This term will be indexed to whatever page the <idx/> tag ends up on using an italic page number. Commonly used for figure and image captions.

  • Word: { XE "Lincoln, Abraham" \i}
  • XML: <idx term="Lincoln, Abraham" pgformat="i"/>

This term will be indexed to the range between the <idx/> tag and the anchor <a id="indx_end_0"/>

  • Word: { XE "Lincoln, Abraham:Gettysburg Address" \r "index_end_0"}
  • XML: <idx term="Lincoln, Abraham" level1="Gettysburg Address" spanto="index_end_0"/>

This term will not be indexed to the page, but a see reference will be added to the InDesign file when it is loaded.

  • Word: { XE "Gettysburg" \t "See Gettysburg Address"}
  • XML: <idx term="Gettysburg" idxref="See Gettysburg Address"/>

Multiple indexes can be differentiated in .sam/.scml by adding a type attribute. The index entry can also be modified to sort on a different word, though this is rarely required. More general sorting fixes can be handled in InDesign.

  • <idx term="Lincoln, Abraham" type="person"/>
  • <idx term="Honest Abe" sort="Lincoln"/>

Planning and Approach

Plan the work

Review the index specifications to determine the amount and type of indexing work expected. What style guide will the index follow? Are there parts of the book that should not be indexed? Does the index have a required length? Review the Indexing Support section above to determine whether an embedded index is right for your project.

Set display to view bookmarks in Microsoft Word.

Under File > Options > Advanced > Show document content, enable “Show boommarks.” This makes it possible to see where a ranged entry begins and ends.

To see the index entries, Show Paragraph Marks must be enabled. On Word’s Home ribbon, click on the pilcrow (paragraph symbol) if it is not enabled.

Enable the Scribe Tools indexing tools

Scribe's indexing tools are available in beta testing on an opt-in basis. To enable the Scribe Tools indexing features, you must directly reach out to Scribe to enable this feature in your copy of Scribe Tools.


1. Index the book in Microsoft Word

Use the SAI’s Index Feature

Using the Index Assistant of the SAI, add embedded index terms to the document. Use HTML-style tags for italic or superscript text within an index entry. Mark a single-page reference to an object using the “Mark” button or the “Mark Range” when a subject is discussed as more than a brief reference. Cross references can also be added through this interface.

Note: Marking entries will highlight potential recurrences of index entries.

If you need to preview the index, you can use the “Insert Index” feature of Microsoft Word under the References tab. This, however, shouldn’t be understood as representing the full and finished formatted index.

2. Convert to InDesign Tagged Text

Upload to the Digital Hub and convert to IDTT. Flow into your book’s template.

Note: Index entries can be added as <idx> entries in a .sam or .scml file for those who prefer to work in a text editor environment. The important thing is that the <idx> terms are in the document before typesetting work begins.

3. Typeset the book

Flow into InDesign

Flow the tagged text into InDesign. If flowing into a template, recompose all stories using Command+Option+/ on Mac or Ctrl+Alt+/ on Windows. This may cause reflow, but it can prevent reflow from occurring later in the project when the text has been set.

Hide index terms

WFDW Indexed metadata is encoded in InDesign using text anchors and index markers. Both character types are tagged with conditional text. If you have multiple indexes, the index markers will be tagged with different conditions, such as index-primary and index-secondary. There is also a text-anchors condition that needs to be hidden.

The quickest way to set up the index and hide these conditions is to run Modify Embedded Index, selecting Set Up Index Data from Hub only, then clicking OK to run.

Hiding the index data will prevent you from accidentally deleting them, as the program warns users before deleting hidden text.

Typeset the book.

Typeset the book as usual. See Scribe’s typsetting standards for more details.

Index entries should be added and deleted using the tools available in Scribe Tools in order to generate the necessary scribing and linking metadata. If the terms themselves need to be edited, the text can be modified using InDesign’s index pane.

  • Add Index Entry: Adds an index entry at the start of your cursor. If you need to tag the entire selection as an index range, select the box indicating as such. If you have more than one index condition in the document, choose the index condition. Index entries cannot be added using this tool if there are no index conditions in the document.
  • Delete Index Entry: Identifies all the index markers on the page and presents as a list to the user. The user can select which of these entries they want to remove. This will remove not only the index marker itself, but the hidden metadata that serves that index marker.

4. Generate index from embedded terms

Run Modify Embedded Index to generate the index the first time. The default options must be run at least once.

Set Up Index Data from Hub

This must be selected the first time you generate an index with data from the Hub. Scribe’s embedded indexing takes advantage of InDesign’s native feature for index entries but builds on these features with in-text callouts that must be converted to metadata within InDesign. If this feature is not run, page ranges will be inaccurate and other unexpected issues may occur.

Set Index Generation Options to Scribe Defaults

Indexes generated by InDesign will systematically scribe the index. To scribe these with the Scribe default settings, select this option. This will prepopulate the Generate Index dialog with Scribe styles. You can modify a few specific settings, such as whether you want to create a nested or run-in index, and what punctuation you want to follow the topic. If you are creating multiple indexes for a book, uncheck “Replace Existing Index” when creating multiple indexes.

Additional options can always be modified from InDesign’s index panel by clicking Generate Index > More Options.

Fix Indexing Sort Order

InDesign’s default is a letter-by-letter sort that is insufficient for most indexes (it does not consider parentheses and commas). Scribe has a tool to fix the letter-by-letter sort so that it considers punctuation, or change to a word-by-word sort. It can also ignore articles and prepositions at the beginning of an entry for the purposes of sorting. Select this option to update the sorting of entries.

Index sorting uses the “sort” attribute of InDesign’s index entry. You can clear sort options before letter-by-letter and word-by-word sorting, or you can choose to clear sorts without resorting.

  • Clear all sorts: clears the sort attribute from all index entries.
  • Clear non-custom sorts: clears only the sort attributes generated by previous runs of this tool.

Update Page Ranges

InDesign’s indexing tool doesn’t allow for dynamic page ranges that look to a text anchor. Scribe Tools calculates this using a link from the index entry to an anchor at the end of the indexable range.

If your book includes index ranges, this option should be set before every index generation to update the page ranges to reflect any changes resulting from page reflow.

(Re)generate the Index

Selecting this option will create a new index story at the end of the document or overwrite an existing index story, depending on the options set under Set Index Generation Options to Scribe Defaults.

If you have multiple index conditions, you will be given the option to choose which index you want to generate. InDesign will only add index terms to a generated index if the condition that they’re part of is visible. This option will change the condition visibility as appropriate to only generate an index from the single chosen condition.

Alternate method of regenerating indexes.

Modify Embedded Index is intended to support most configuration cases for index settings. Occasionally you may need to modify additional settings directly in InDesign’s Generate Index tool. This should only ever be done after creating an index once using Scribe Tools.

Expand the Conditional Text pane and decide which index you will generate first (if there are multiple conditions). Make the other indexes invisible (click the eye icons so that only the index you want to generate has an eye next to it).

Run Generate Index from InDesign’s index panel and select More Options to modify these.

Enter an index title and confirm or change the options and styles listed. Most of the options in this dialog can probably be left as-is for most indexes. If you are generating a second or third or nth index, uncheck “Replace Existing Index.” Click OK. Depending on the size of the index, you might experience some delay. Eventually you will get a loaded cursor. Place the index in the desired text frame.

Be aware that if you must regenerate the index, any changes will be lost. If you regenerate the index using the Scribe Tools, selecting “Set Index Generation Options to Scribe Defaults” will overwrite your previous settings, so it’s best not to check this if you’ve already set these options through the InDesign interface.

5. Perform quality control checks on the typeset indexer

An indexer or copyeditor should run quality control checks on the typeset index to confirm that all elements are sorting and displaying in an appropriate manner.

Export the XML and process to sam to confirm you have the same number of idx terms that were there when you converted the document into InDesign.