44
Word’s numbering explained (article contributed by John McGhie)
Page 17 of 25
5 Numbering in action
Copyright © 2000 by the Microsoft Word MVPs.
5.2 Tables of contents
The Table of contents (TOC) is not a Numbered List. It simply copies the text of the
headings in page number order, including any numbering that may be applied. If the
headings have numbers, the TOC generator copies those numbers. The generator
automatically applies TOC Styles 1 to 9 to format the TOC. The generator sets the
styles to Automatically Update, which enables it to automatically set their formatting
according to hard-coded defaults chosen by the TOC format setting. If you want to
prevent this, set your TOC format to “From Template”. Word will then leave the
formatting of your TOC styles alone.
Simple and stable: not much goes wrong with TOCs for this reason. The only catch is
that the entire TOC is a field itself, and if you don’t know this, you can mangle it.
The generator actually generates the page numbers in the TOC by inserting a hidden
bookmark at every Heading in the document. In the TOC itself, Word 97 generates a
hyperlinked PAGEREF field for each page number, referencing the appropriate
heading (if you click on the page number it takes you to the Heading). In Word 2000
it generates a more complex hyperlinked field, which allows you to click on the text
in the TOC to go to the referenced Heading.
Either way, you can see these hyperlink fields by right-clicking any page number
and selecting "Toggle Field Codes". You can see the hidden bookmarks by selecting
any Heading in the document, selecting Insert>Bookmark, and ticking the "Show
Hidden Bookmarks" checkbox. The hidden bookmark applied to the heading you
are in will be selected in the dialog, and its name will tally with that in the relevant
field in the TOC itself.
When you update the TOC (by selecting it, pressing F9, and choosing "Update entire
Table"), all the hidden bookmarks that have been applied to the Headings are
deleted and recreated - you can see that their names have changed, if you look.
However, prior to Word 97, the hidden bookmarks were not deleted when you
regenerated the TOC; instead, a new set of bookmarks was created each time; so you
could very quickly end up with hundreds of redundant bookmarks, leading to a
huge increase in file size and, frequently, to document corruption.
You can convert the entire TOC to ordinary text. If you do, the styles remain applied
and the entries are all converted to hard text. People sometimes do this to prevent
document corruption. In Word 6, if you re-generated the TOC too many times, the
document would corrupt, so people would convert the TOC to hard text to prevent
this happening. This is no longer so necessary in Word 95 and above, but you may
find it in up-converted documents. The problem with the technique is that when the
document gets to a different computer, the page numbers in the TOC will be wrong.
You will rarely see problems with TOC numbering. If you do, unless the user has
manually typed the wrong numbers into the TOC, the problem exists in the body of
the document, not in the TOC. If you regenerate the TOC, you remove any manually
41
Word’s numbering explained (article contributed by John McGhie)
Page 18 of 25
5 Numbering in action
Copyright © 2000 by the Microsoft Word MVPs.
typed numbers, unless they are in the body of the document. In fact, the TOC is an
excellent device for looking for numbering problems in the body of the document.
Since you have to check the TOC anyway before you publish, you might as well look
for numbering problems while you are at it.
5.3 Index
The Index works in a similar way to the TOC (although unlike the TOC, the index
contains no hyperlinks). Index styles 1 to 9 set the formatting, and the Index
generator automatically applies them. The index generator copies the page numbers
from the page number built-in counter Word maintains. Again, it is simple and
stable.
If you see bad numbers in the Index, it means the page numbering in the document
is bad. Often, it is because the user has forgotten to suppress the display of hidden
text before generating the Index. The hidden text throws various paragraphs onto the
following page: when you print the book, the page numbers in the index don’t match
those printed. A trap for young players...
5.4 Chapter numbering
There are several ways of applying Chapter Numbering. You can apply it as part of a
style, or as direct formatting, or type it.
By rights, the Chapter heading should be Heading 1 style, and the user should have
used the list template that shows the word “Chapter” in its picture. If they did, the
chapter numbers are part of the heading numbers outline numbered list template.
Some people elect to type in the chapter number, particularly if the chapters are
separate files. If they do this, they frequently forget to check the chapter numbers
when they add a chapter. Gotcha!
People working with multiple files sometimes use Heading 1 for the Chapter
heading, but manually set its starting number. If you right-click the chapter title,
immediately after the chapter number, you can set the Start-At number. This is a
fertile source of bother. Any time the user updates the style, they must manually
reset all the chapter numbers. If the chapter ever becomes part of a master document,
the master document resets the chapter numbering each time a user opens the
document. If the template is attached with Automatically Update Styles set, the
chapter numbers are reset each time the document opens.
If the chapter numbering is applied by direct formatting, odd corruptions are
possible if you redefine the style upon which the numbering is based. The classic
case is where the direct formatting list template is different from the list template
associated with the styles. The cure is to remove all numbering and re-apply just one
kind.
43
Word’s numbering explained (article contributed by John McGhie)
Page 19 of 25
5 Numbering in action
Copyright © 2000 by the Microsoft Word MVPs.
5.5 Heading numbering
Heading Numbering is simply a list template in which levels 1 to 9 are attached to
styles 1 to 9 (normally, Heading 1 through Heading 9).
Heading numbering is more stable than other types because (as long as you define it
correctly initially) it is usually a single list, and it almost never restarts. Where you
get problems with heading numbering, remove it and re-apply it. This should re-
create it as a single list if it has become broken into pieces.
You have to be looking for trouble to break heading numbering. Unfortunately,
converting the document to a different format is “looking for trouble.” Converting
between Word 6 or 95 and Word 97/98/2000/2001 is thrill seeking, and converting a
document to or from WordPerfect is almost guaranteed to break it.
In the default list templates seen in the Format>Bullets and Numbering dialog under
the Outline Numbered tab, three of the samples show the word “heading” in their
pictures. These list templates are automatically associated with the built-in heading
styles Heading 1 through Heading 9. By default, Word’s built-in heading styles have
list levels 1 to 9 assigned. It’s this list level that governs the operation of the heading
outline numbering.
There are three ways of applying heading numbering: with a style, by direct
formatting, or typing. Professional writers tend to apply it with styles, corporate
users tend to apply it as direct formatting. Users in trouble sometimes try to correct it
by typing it. Any document that has ever been saved to a text-based format or to a
format earlier than Word 6 will have hard-typed numbering throughout.
If the numbering has been applied with styles, it is robust and unlikely to
malfunction. Because each style can point at only one list template, all headings in
the document are likely to be members of the same list. Text copied from other
documents should assume the style definition of the destination document, and thus,
become a member of the same list.
When applying heading numbering, it pays to take great care that you use a default
list template that is associated with the Heading styles. These list templates have
special properties: they “know” that they belong on Headings. If you decide to use a
different list template for heading numbering, you must first create your styles 1
through nine, then assign each of the styles an outline level, and finally associate
each level of your outline list template with a different style. It’s a lot of work, and
it’s not worth it: Use the built-in Heading styles: the work has been done for you.
You should apply heading numbering using Format>Style.
Trouble may break out if the user starts fiddling around with the style definitions.
They may associate the same style with more than one level in the list template. A
classic example is to have Heading 1 associated with Level 1 (the chapters) and Level
5 (the appendices). This was a recommended work-around for Appendix numbering
38
Word’s numbering explained (article contributed by John McGhie)
Page 20 of 25
5 Numbering in action
Copyright © 2000 by the Microsoft Word MVPs.
in Word 6 and 95, so you will often see it in up-converted documents. You need to
reset the list template to cure this.
A rare error, but a far more damaging one, is to have the same style associated with
more than one level in a list. You often see this in corporate documents: the list
template is simply cactus: remove and replace it.
A variation on this is that various heading levels are members of different list
templates. This is perhaps the most common spaghetti-numbering error in corporate
documents. Both list templates are now corrupt: you have to remove both, reset both,
and re-apply just one of them.
5.5.1 Direct Formatting Headings
If the numbering is applied as direct formatting, it should be applied from the first
Heading 1 in the document, all the chapters should be in the same document, and
the Chapter Titles should all be Heading 1 style. If the author follows these rules, all
will be well. And pigs might fly...
If you apply heading numbering using Format>Bullets and Numbering you apply it
as direct formatting, which is not stable. The list template it is applied as direct
formatting, but only to those paragraphs that currently have the built-in Heading
styles applied. This updates the document’s internal style so that it points to the list
template. However, paragraphs copied in from another document may not correctly
accept the numbering, and if the style is re-applied from the template, the headings
may lose their numbering, or the template numbering may conflict with the local
numbering and corrupt the document.
This can lead to a really nasty situation where you re-apply, for example, Heading 3.
This sets the Heading 3 paragraphs in the document as members of a different list.
Problems will occur when text is copied from another document. That text may or
may not have heading numbering already applied. Even if it does, it cannot have the
same list template applied. So some or all of the copied text may be in a different
outline numbered template from the rest of the document. This is the beginning of
the “spaghetti numbering” bug. In spaghetti numbering, one or more heading
numbers are out of sequence, and try as you might, you cannot get all the headings
to number correctly.
If you catch it early, the cure is simple: remove the heading numbering, save the
document and close it. Then re-open it, and re-apply the heading numbering from
the first Heading 1 in the document.
Documents you may be interested
Documents you may be interested