Creative Tips #8: Table of Contents
If there's one thing about creating a long document that is really painful to do by hand, it's setting up a table of contents ("TOC" to battle-hardened text wranglers). I see this often with books, employee manuals and the like that someone has asked me to edit or design. The author has painfully gone through the entire manuscript, typed all the chapter and section headings in a long table, and typed in the page numbers.
What's so bad about that? Not much, until you start to edit the document, add or subtract a few paragraphs or just change the font. Suddenly every chapter after the first one has to have its page number changed in the TOC. And if there are two or three rounds of revisions, or next year something changes that needs an extra chapter, the time spent on fixing the TOC starts to really add up, not to mention the likelihood of making some sort of error.
I don't know about you, but my time is worth enough that I don't want to spend it doing something my word processor can do automatically in less time than it takes to say "Table of Contents." If you're an executive creating documents for clients, or a Human Resources specialist writing job descriptions and manuals, or even if you just want to get your novel into great shape, figure out what your time is worth per hour. It doesn't take a math genius to see that things can get very expensive if you do them the long way.
The answer is to use the built-in TOC feature of your word processor to create it for you. All you have to do is follow the rules when you write the text.
Rules? What rules? We'll get to those in a moment.
What's Your Style?
Word, Open Office, any mainstream word processor, was created with business users in mind. (Screenwriters, authors and the like just came along for the ride.) When the programmers invented Styles as a feature, and had to decide what predefined styles to include, they picked the kinds of things that everyone uses: body (regular) text, headings, bulleted lists, numbered lists, quotations; the common layout items you will find in almost any set of business documents.
It wasn't long before someone thought: "A word processor ought to be able to create tables of contents."
"Great!" said the engineering team. "People use headings to mark new chapters and sections, so we'll use those styles to build an automatic table of contents!" This was a fantastic idea, except for two things: 1) hardly anyone knew these heading styles existed, and 2) the TOC feature ended up in a sub-menu where only an Indiana Jones could find it.
Let's unscrew the inscrutable, and see how all this works.
Using Headings
Your chapter or main section titles should all be given a "Heading 1" style. Sections within chapters, or sub-sections of the main parts of the document must be "Heading 2", "Heading 3", etc. for as many levels as you need. Unless you're writing a really dry textbook or a long legal document, I recommend sticking with just the first two. (If you don't recall how to set styles, review the last newsletter where we covered assigning and modifying styles in Word and Open Office.) For now, don't worry how they look. You can change the font, size, color and position later. Just make sure that every chapter title is a "Heading 1" and every section title within the chapter is a "Heading 2."
To make it easier to follow along, I've created a document with a table of contents that you can download here. If you've been following along with these newsletters, you might find it interesting to explore how the styles are set up. All but one of the styles use style names built into Word. The exception, "TOC Title," is one that I made up for the title at the start of the Table of Contents page.
The TOC, on page 2, shows chapter headings in bold text (Lucida Sans) and sections in a smaller, regular text (Garamond).

"Lorem Ipsum" is divided into chapters, with each chapter starting on a new page. Go to page 3 and click in the chapter title "What It Is." (If you don't have style names visible in the toolbar, click on the Format menu item and choose Styles and Formatting from the list.) You will see that the style is Heading 1. For this document I modified Heading 1 from its default of Arial to Garamond Bold, changed the size and added "Page Break Before" to the paragraph formatting so that every chapter would begin on its own page. You can see all the modifications by exploring either the style itself or the Font and Paragraph format selections from the Format menu.
On page 4, the chapter section titles, "The Forest and the Trees" and "The Chicken and the Egg," are styled as Heading 2, which I also modified from Word's default.
As far as the TOC is concerned, these are the only vital styles in the document. The rest could be anything you want. With these styles in place, we are ready to create the Table of Contents, so if you're feeling brave, go ahead and delete the one that's already there, but leave your cursor in the same place. (You don't have to. What follows will work the same, as long as your cursor is somewhere in the TOC.)
Creating the TOC
In Word 2007, Microsoft made this feature a little easier to find. In earlier versions it is buried under the Insert menu, under Reference, where you will find a selection called "Index and Tables." Select this, and in the dialog box that pops up, click on the "Table of Contents" tab. Only an engineer could come up with something that obscure.

If you are using a different word processor, look up "Table of Contents" in the Help menu, and find out where it's hidden. With any luck, it won't be as hard to find.
There are two more steps before you click "OK": choosing what styles will appear as TOC entries, and setting up what those entries will look like, because you probably don't want them to look like the original text.
Selecting the TOC Entries
By default, your word processor will use all the Heading styles as TOC entries, and possibly some others. It will assume that Heading 1 is the most important, Heading 2 is next, and so on, each level getting a lower-order entry in the TOC. It will likely add a "dot leader" (a row of dots) between the heading text and the page number. You can change all of these using the font, paragraph and tab settings we've already talked about.
First, under the Options button, select the styles that the TOC entries will be created from. "TOC level" means which level of the hierarchy a particular style belongs to. Main entries are 1, sub entries are 2, sub sub entries are 3, and so on. Each will have its own style, so it's important to assign these correctly.

In this example, I've made sure that Headings 1, 2 and 3 are selected, and that everything else is blank. The TOC Level for each style is already there by default, so I haven't changed them. Click OK.
Styling the TOC
Now that we've selected what will be in our Table of Contents, the Modify button allows us to select and modify the styles that will be applied to each entry. Click on Modify.

I deliberately reversed the fonts used in the text, so Lucida Sans is font for TOC Level 1, and Garamond is used for TOC Level 2. You can see the description of everything that is in the TOC 1 paragraph style at the bottom of the dialog, but click Modify for a complete look at how this and TOC 2 were set up. Experiment with different settings, just for fun and to see where you can take this.
Click OK to set the styles, then OK to insert the Table of Contents.
This has been longer than most Creative Tips, because we had a lot to cover. If I've left anything out, or if you have questions, feel free to email me. The same goes for anything you'd like to see in a future issue of Creative Tips.
Bonus Tip
Jon von Gunten recently posted a link to an article titled "25 Things You Didn't Know About Microsoft." The article contained this little gem for Word and Powerpoint users: if you type =rand(5,5) and press Enter, you will get five paragraphs of text containing five sentences of "The quick brown fox jumped over the lazy dog." Change the numbers to change the number of paragraphs and the number of sentences.
Happy typesetting,
Alan Gilbertson
Creative Director
G&G Creative
The Creative Tips newsletter is published by G&G Creative, Tujunga, CA. More at www.gngcreative.com or on the blog.
G&G Creative specializes in graphic design, photography and copy writing for print and the web.
Copyright © 2009 Alan Gilbertson. All Rights Reserved.