Sanjeev Sabhlok's notes on technology, hardware, gardening

Create “parts” in a table of contents in Word. The most advanced guidance re: table of contents

This is excellent information.

I have not tried it but is very promising

Omitting page numbers for noncontiguous levels

Suppose you have want to have centered part titles without page numbers (TOC 1), chapter titles with page numbers (TOC 2), and some other text (subheadings or a blurb like that in Figure 4) without page numbers (TOC 3). In other words, you want to omit page numbers from TOC 1 and TOC 3 and include them for TOC 2. You can’t have more than one \n switch, and there’s no way to include 1–3 without including 2, so you might think this can’t be done—and it can’t, at least not that way. You just need to be devious!

The trick is to swap styles. You need to use TOC 2 for Heading 1 and TOC 1 for Heading 2, and omit page numbers for TOC 2 and 3. In the Table of Contents Options dialog, type 2 beside Heading 1 and 1 beside Heading 2. Clear the check box for “Outline levels” (because you haven’t changed the outline levels of these styles). Insert the TOC, then edit the field code to add the \n 2-3 switch. This will give you the following:

{ TOC \o "3-3" \n 2-3 \h \z \t "Heading 1,2,Heading 2,1" }

Now swap the formatting of TOC 1 and TOC 2; that is, make TOC 2 centered and TOC 1 left-aligned, to match the heading levels to which they are assigned. You’ll get something that looks like Figure 12.

A TOC with unnumbered Heading 1 and Heading 3 entries

Figure 12. A TOC with unnumbered Heading 1 and Heading 3 entries


View more posts from this author

Leave a Reply

Your email address will not be published. Required fields are marked *