I've got this post with a PDF from my workbooks on how to create tables of contents. However, I wanted to also make one that's just here in the web site, and with fewer details.
This is a table of contents in Writer. Never, ever create one from scratch. It is so much easier to create one automatically.
- The gray part doesn't print; it's just there to indicate that there's something automatic happening.
- You can change how each level looks just by modifying certain styles; more on that later.
- If you make changes to the document, then right-click on the TOC and choose Update, the TOC will automatically reflect the changes in the document. Page numbers will be correct, etc.
Creating a Table of Contents: Step 1, Select and Apply Paragraph Styles
Writer knows what to put in the TOC based on what paragraph styles you tell it to look at. Paragraph styles like Heading1 etc. should be applied to the headings in the document. So plan and apply the paragraph styles that set up the structure of the document.
Paragraph styles are here; choose Format > Styles and Formatting. You can use existing ones such as Heading1 through Heading10 (recommended) or create your own.
For instance, in this document I decided that the first heading (chapter) would have Heading1 paragraph style applied; the second level down would have Heading2 paragraph style applied, and so on. So in this illustration, the heading Types of Bread has the Heading2 style applied.
So that's what you do.
- Decide what paragraph styles you'll use on the top-level headings, the second-level headings, and so on.
- Apply those styles to the headings.
To apply a style:
- Click in the heading
- And either double-click the style name in the Styles and Formatting window, or if it's there, select it in the dropdown list on the left.
Do that to every heading in your document. This is of course less of a pain if you do it as you write the document rather than all at once afterwards.
In the window that appears, just make your changes and click OK.
Creating a Table of Contents: Step 2, Set Up the Table of Contents
Click in your document before any of the content. Then choose Insert > Indexes and Tables > Indexes and Tables. This window will appear.
First, check the number of levels you want to include. If you don't want all of them, change the Evaluate Up To Level setting.
Then be sure that the Outline checkbox is marked. Click the ... icon next to it.
Creating a Table of Contents: Step 3, Modifying the Table of Contents
If you don't like how the TOC looks, modify the styles used to format the TOC. Right-click on a line in the TOC that you don't like and choose Edit Paragraph Style.
In the window that appears, change the settings, then click OK.
Is That All There Is?
Definitely not. See this blog for more info including how to make the TOC hotlinked. But you're well on your way.