How to use style separators with heading style to generate a TOC in Word

Applies to: Word 2019Word 2016Word 2013 More

This article introduces how to use the style separators feature with heading style to generate a table of contents (TOC) in Word. If you are looking for how to add and manage a TOC, see Insert a table of contents.

Use style separators with heading style


Insert the style separator to divide texts before you apply the heading style to your text. The style separator is a hidden paragraph mark that serves as a delineator between separate styles applied in a document. For more information, see style separator.

Note You may show style separators and add style separators button to toolbar in order to follow these steps easier.

  1. Use style separators to divide text. You can use the following steps:
    • Click the Style Separator button, type the text that you want to include in the TOC, and then click the Style Separator button again.
      Style Separator
    • Create two paragraphs of texts, position the cursor in the first paragraph, and then click the Style Separator button.
      Note The two paragraphs are displayed to become a single paragraph by converting the paragraph mark at the end of the first paragraph to a style separator.
      Style Separators
  2. Position the cursor to the part of the text that you want to include in the TOC.
  3. Click the drop-down arrow in the Styles box on the Home tab, and then select the heading that you want.

Update the TOC with changes

Click Update Table in the Table of Contents group on the References tab, select Update the Entire table, and then click OK.

Update TOC

 

More information


Style Separators

The style separator is a newly introduced feature since Word 2002 and Word 2003. Style separator tags allow you to do the following:  

  • Apply heading styles to a single word or phrase in a paragraph so that only that word or phrase appears in the TOC.
  • Include two styles in a single paragraph so that the lead-in paragraph appears in the TOC.
  • Apply outline levels to lead-in text so that only the lead-in text appears in the TOC.
  • Apply outline levels to a single word or phrase in a paragraph so that only that word or phrase appears in the TOC.

Show style separator

Under Home tab, click the

button
 in the Paragraph group.

Add the Style Separator button to the toolbar

Before you can use the Style Separator feature, you must add the Style Separator button to your toolbar. To do this, follow these steps:

  1. Click the Microsoft Office button, and then click Word Options.
  2. Click Customize.
  3. In the Choose commands from list, click All Commands.
  4. In the list of commands, click Style Separator, click Add, and then click OK.

Note The style separator is a special form of a hidden paragraph mark. Therefore, documents with style separators that are created in Word 2002 and in later versions of Word appear the same in Word 2000 and in Microsoft Word 97 unless you click All under Formatting Marks. If you click All under Formatting Marks in earlier versions of Word, the style separator hidden paragraph mark is displayed as a normal paragraph mark, and the document will be repaginated.

When you use an earlier version of Word to view documents that have style separators that were created in Word 2002 and in later versions of Word, do not click All under Formatting Marks.

How does Word add headings to TOC

When texts formatted as a heading level appear in the document's TOC, there are no special characters in the paragraph to indicate lead-in emphasis applied to the text. The whole process is seamless. Word uses a new underlying feature named "Linked character styles" to do this.

The heading style applied to the lead-in part of the document is displayed as a heading style. But it is actually a linked character style. In Word 2002 and later versions, when you apply a paragraph style to a subset of paragraph, the following behavior occurs:

  • A hidden character style is created and takes the same character properties as the paragraph style is applied.
  • The character style is applied to the selection.

Note The hidden character style created with linked character styles appears in the Style drop-down list if the document is opened and viewed in earlier versions of Word. The functionality of the style separator is lost if the document is saved in an earlier version of Word.

To view the hidden character style, follow these steps:

  1. Under Home tab, click the Styles dialog box launcher
    utton
    in the Styles group, and then click Style Inspector
    button
    .
  2. In the Style Inspector popup window, click Reveal Formatting
    button
    .

Then

  • Select the text in your document and notice that exact formatting details appear in the Reveal Formatting task pane.
  • Select the text that has the character style applied and notice that the text is displayed as a character style in the Reveal Formatting task pane. The linked style is displayed as Heading Char in the Reveal Formatting task pane. The actual character style remains hidden in the Styles and Formatting task pane or the Style drop-down list on the Formatting toolbar.
Any paragraph style can be used for the linked character style. A paragraph style can be created and looks exactly like the body text paragraph style, and then applied to a part of a paragraph. In this manner, the text that's used to build the TOC can exactly match the text in the paragraph, assuming the TOC options are modified to include the style for the lead-in text.