How can I include just part of a paragraph in my table of contents?
Word’s Help file, under “Create a table of contents,” is very helpful in explaining how to create a table of contents based on styles (built-in or custom), outline levels, and TC fields. In addition Word MVP Shauna Kelly’s article “How to create a table of contents in Microsoft Word” gives step-by-step instructions. Styles and outline levels are so easy to use that most users never get around to figuring out TC fields, and so sometimes they run into trouble.
As long as the heading you want included in the TOC is a complete paragraph, there is no problem, but what if you have a “run-in sidehead”? That is, suppose you have a document in the following form:
How are you going to get the Heading 3 into the TOC without including all the text that follows it? There are three ways.
The oldest and often still best solution is to use a TC field. Word’s Help (under “Field codes: TC (Table of Contents Entry) field”) is pretty good on this subject, too. You insert a field in the paragraph (immediately preceding or following the heading portion is a reasonable place, but anywhere that is bound to be on the same page with the heading will do), specifying the text you want to appear in the TOC and the appropriate level. In the case of the example heading, that field would look like this:
You can construct the field by hand (by pressing Ctrl+F9 to insert the field delimiters—those things that look like braces but can’t be typed from the keyboard—and typing the text between them), by using Insert | Field (in Word 2007 and above, this is Insert | Text | Quick Parts | Field), or—most easily—by pressing Alt+Shift+O. If you select the heading text before using this keyboard shortcut, the text will already be inserted in the Mark Table of Contents Entry dialog, and you need only change the level to 3, then press Enter to mark the text and Enter again to close the dialog. The required field is automatically inserted following the text. The field that Word will insert will look like this:
The “\f C” switch tells Word you want this entry in your main table of contents. If you have only one, this switch is unnecessary, but if you want to have more than one, you can use different “type identifiers” (usually letters from A to Z) to direct the entries to different TOCs. [I have no idea why Word puts the level number in quotes; the Help article does not show this, and it is not necessary.]
When you insert a table of contents in your document using Insert | Index and Tables (Insert | Reference | Index and Tables in Word 2002 and 2003; References | Table of Contents | Table of Contents in Word 2007 and above), be sure to check the box for “Table entry fields” in the Options dialog (along with “Styles” if you’re picking up built-in heading styles for other levels). This inserts the \f switch that is required in the TOC field to tell Word to use TC fields.
All of the above is well documented in Word’s Help, in the “Create a table of contents from entries you mark yourself” section of the “Create a table of contents” article.
Hidden paragraph mark
Although TC fields are really quite easy to use once you get the hang of them, if you have no experience using fields, you may be looking for another way. There is a workaround that many users have relied on through many versions of Word and that works so well that Microsoft has imitated it (see next section).
Using this method you type your heading and following text as separate paragraphs:
But now you want a Heading 3 that is part of a text paragraph.
Ut wisi enim ad minim veniam, etc.
Format the first paragraph as Heading 3 (or whatever style you’re using for this heading level) and the second paragraph as Body Text (or whatever text you’re using for the text paragraphs).
If you don’t have nonprinting characters displayed, press the Show/Hide ¶ button () on the Standard toolbar to display them (this button is in the Paragraph group on the Home tab of the Ribbon in Word 2007 and above). You should see your paragraphs like this:
But now you want a Heading 3 that is part of a text paragraph.¶
Ut wisi enim ad minim veniam, etc.¶
Select just the paragraph mark (¶) at the end of the first paragraph (your heading) and format it as Hidden (Ctrl+Shift+H or right-click and choose Font from the context menu; in the Font dialog, check the box for “Hidden” and click OK). You will not immediately see any change, but when you press the Show/Hide ¶ button again, your two paragraphs will sweetly join.
Lead-in emphasis and style separator
If you have Word 2002 or above, you can use either of two new features introduced in that version: lead-in emphasis, which takes advantage of "linked styles" (character styles that use the font formatting of paragraph styles), and the style separator, which works very similarly to the Hidden paragraph mark but is transparent to the user: it doesn’t display two separate paragraphs even when Hidden text is displayed, though the style separator is displayed as a paragraph mark (in the middle of the paragraph) with a dotted box around it.
To use the style separator, you must first prepare two separate paragraphs as described above for using the Hidden paragraph mark. Then click anywhere in the first paragraph and press Alt+Ctrl+Enter. The style separator will appear at the end of the paragraph (replacing the paragraph mark), and the following paragraph will come up to join it. The paragraphs will be joined even when nonprinting characters are displayed, and you do not need to change the view in order to generate a TOC or index.
To learn more about the use of these features, see the following Microsoft Knowledge Base articles:
“How to create a table of contents by marking text in Word” (applies to Word 2002, 2003, 2007, 2010, and 2013)
This article copyright © 2002, 2004, 2008, 2010, 2011, 2014 by Suzanne S. Barnhill.