Tying your heading styles to the table of contents tool can make your final product more useful.
Now we need to add a table of contents to our document. The table of contents tool looks for styles we have incorporated into the document. It looks for markup in the document and uses the markup it sees.
To do so, we'll use The Thirty-nine Steps, by John Buchan from Project Gutenberg.
So, now we create a table of contents.
The table of contents tool places the object it creates in the location where the cursor is located at the time the "insert" command is executed. So we need to have a place created in which the table of contents is to be inserted.
We have entered the words "Table of Contents" here and want to place our cursor at the start of the next paragraph object, to let the tool know where to place the table of contents.
In our document, all the chapter numbers are in heading 1 style, and all the chapter titles are in heading 2. For the purposes of our document, the table of contents seems more useful if we arrange in by chapter titles, hence by heading 2 entries. This necessitates that we not use one of the automatic tables, but rather go one level deeper to find the custom table of contents dialog boxes.
But this creates addditional choices for us. Having decided to use only one level, the tool defaults to using the heading 1 elements. But we want it to use the heading 2 elements instead. So we have to look at our options.
Our options permit us to delete the ToC Level 1 from heading 1 and instead to enter ToC level 1 next to heading 2. This means the tool will look for instances of heading 2 in the document and will register the page number where it finds them, and then will use what it finds in the table of contents as the top level of table of contents elements - ToC level 1. Nothing will change in the looks of the text, but the heading 2 text will be placed in the table of contents in the ToC Level 1 style.
Having said "OK" to the options, and "OK" to the Table of Contents dialog box, we have a nicely formatted table of contents on page 3 of our document.
Copyright © R.E. Bergquist 2014- | Last Updated on | Powered by w3.css