Table of Content - partial heading only

H

Hong

Hi

I have Heading 1 style as numbered prefixed by "Chapter". So, Heading 1 in
my document, will be automatically labelled as, Chapter 1, Chapter 2, etc.
Other heading styles are only numbered.

When creating the TOC, I get:
Chapter 1 ....
1.1 ...
1.2 ...
Chapter 2 ...
....

How can I ask it not to display the "Chapter" in TOC? I need:
1 ...
1.1 ...
1.2 ...
2 ..
....

In addition, the lines with Chapter in the TOC will have the page number
'overshoot':
Chapter 1 ................................................ 1
1.1 .....................................3
1.2 .....................................5
Chapter 2 ................................................ 7
....

3 and 5 are aligned correctly to the right margin. 1 and 7 overshoot beyong
the right margin. How can I rectify this?

Sorry for long story. Thanks for any help given.
 
S

Stefan Blom

Question 1
----------
a) Use TC fields to include the text of Heading 1 paragraphs into the
TOC: For each Heading 1, select the text and press ALT+SHIFT+o (the
letter "o", not the number zero!). Word displays the Mark Table of
Contents Entry dialog box. Make sure the Level is set to 1, and click
OK.

b) Modify the TOC 1 style to include numbering.

c) Now, you'll have to make modifications to the table of contents
settings. Since a TOC is a field, you don't need to do this from the
Index and Tables dialog box. Instead, you can display and directly
modify the so-called field code. A field code, generally speaking,
consists of the field name and possibly also of one or more switches,
which are characters preceded by a backslash. Switches might be
followed by a list of arguments. You can use ALT+F9 to toggle display
of field codes in Word.

With field codes displayed, you'll see TOC (the name of the table of
contents field) instead of your table of contents. The switches
present in the code depend on the options you chose when you inserted
the TOC, but if you using the built-in headings, you should see
something like { TOC \o "1-3" \h } or possibly { TOC \t "Heading
1,1,Heading 2,2,Heading 3,3" \h }.

What do the switches mean? Well, the \h switch, available in Word 2000
and later, causes each TOC entry to be a hyperlink to the referenced
heading. The \o switch instructs Word to include any paragraph style
with an outline level specified (in its Paragraph properties). The \t
switch explicitly lists paragraph style names and their table of
contents levels. Of course, if you have more levels than three in your
TOC, you'll see either larger numbers with the \o switch or more
entries following the \t switch, in your TOC field code. (You can read
more about the TOC field and its switches in the article at
http://word.mvps.org/faqs/formatting/TOCSwitches.htm.)

Modify the field code so that it reads { TOC \o "2-3 \f \h } or, if
you see the second of my examples above, use { TOC \"Heading
2,2,Heading 3,3" \f \h }.

In summary, the changes to the code include clearing the top-level
Heading 1 style from the TOC field code and adding the \f switch
(which instructs Word to include marked TOC entries to create the
TOC).

d) Press F9 to update the table of contents.

e) Press ALT+F9 again to hide field codes, and show field results
again.

Question 2
 
H

Hong

Thanks a lot Stefan!


Stefan Blom said:
Question 1
----------
a) Use TC fields to include the text of Heading 1 paragraphs into the
TOC: For each Heading 1, select the text and press ALT+SHIFT+o (the
letter "o", not the number zero!). Word displays the Mark Table of
Contents Entry dialog box. Make sure the Level is set to 1, and click
OK.

b) Modify the TOC 1 style to include numbering.

c) Now, you'll have to make modifications to the table of contents
settings. Since a TOC is a field, you don't need to do this from the
Index and Tables dialog box. Instead, you can display and directly
modify the so-called field code. A field code, generally speaking,
consists of the field name and possibly also of one or more switches,
which are characters preceded by a backslash. Switches might be
followed by a list of arguments. You can use ALT+F9 to toggle display
of field codes in Word.

With field codes displayed, you'll see TOC (the name of the table of
contents field) instead of your table of contents. The switches
present in the code depend on the options you chose when you inserted
the TOC, but if you using the built-in headings, you should see
something like { TOC \o "1-3" \h } or possibly { TOC \t "Heading
1,1,Heading 2,2,Heading 3,3" \h }.

What do the switches mean? Well, the \h switch, available in Word 2000
and later, causes each TOC entry to be a hyperlink to the referenced
heading. The \o switch instructs Word to include any paragraph style
with an outline level specified (in its Paragraph properties). The \t
switch explicitly lists paragraph style names and their table of
contents levels. Of course, if you have more levels than three in your
TOC, you'll see either larger numbers with the \o switch or more
entries following the \t switch, in your TOC field code. (You can read
more about the TOC field and its switches in the article at
http://word.mvps.org/faqs/formatting/TOCSwitches.htm.)

Modify the field code so that it reads { TOC \o "2-3 \f \h } or, if
you see the second of my examples above, use { TOC \"Heading
2,2,Heading 3,3" \f \h }.

In summary, the changes to the code include clearing the top-level
Heading 1 style from the TOC field code and adding the \f switch
(which instructs Word to include marked TOC entries to create the
TOC).

d) Press F9 to update the table of contents.

e) Press ALT+F9 again to hide field codes, and show field results
again.

Question 2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top