Forum Discussion
Table of contents - include only heading's numbering but excluding text
Charles, what you are suggesting would normally work. However, something appears to be wrong in Word. An auto number (in Heading 1 style) is ignored by the TOC, even when a space character (nonbreaking or breaking space) follows the number. Are you seeing the same thing? I am running Word 2021 Professional, version 2305.
Here is a sample document where the TOC fails.
- Charles_KenyonJun 21, 2023Bronze Contributor
You are, of course, correct. I am surprised and somewhat flummoxed. Without the Style Separator, with just a blank space, and no other text, the automatic number will show up in the TOC. but not with the Style Separator.Simply hiding the paragraph mark is the same as the Style Separator.
My next suggestion would be to use a TC field at level 3 and include a ListNum field or StyleRef for the number, and not include Heading 3 or that outline level in the TOC. This is harder, but can be done. KlaCat , if you would like such a field example, I would be happy to provide one.
- KlaCatJun 21, 2023Copper ContributorI'd appreciate it very much.
- Charles_KenyonJun 21, 2023Bronze Contributor
Here is a temporary link to a document with such a field.
https://www.dropbox.com/s/h56vqgwg9ikm44o/deleteme.docx?dl=0
The TOC Field is: { TOC \o "1-2" \f \h \z }
The TC Field is { TC { STYLEREF "Heading 3" \n } \l 3 } and should be at the end of every level three paragraph. You can select the field and save it as AutoText for easy insertion. A keyboard shortcut can be attached to an AutoText entry.