Documentation/How Tos/Creating Automatic Tables of Contents

From Wiki
Jump to navigationJump to search


This is a table of contents in Writer. Never, ever create one from scratch. It is so much easier to create one automatically.

File:Doc HowTo TOC.png
Table of contents example in OpenOffice.org
  • The gray part does not print; it is just there to indicate that there is something automatically 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 table of contents and choose Update, the table of contents will automatically reflect the changes in the document. Page numbers will be correct, etc.

Step 1: To Select and Apply Paragraph Styles

Writer knows what to put in the table of contents based on what paragraph styles you tell it to look at. Paragraph styles like Heading1 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 in the Styles and Formatting window; choose Format > Styles and Formatting. You can use existing ones such as Heading1 through Heading10 (recommended) or create your own.

So that's what you do.

  1. Decide what paragraph styles you will use on the top-level headings, the second-level headings, and so on.
  2. Apply those styles to the headings.

To apply a style:

  1. Click in the heading
  2. And either double-click the style name in the Styles and Formatting window, or if it is 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.

Documentation note.png If you apply Heading1, Heading2 and so on and do not like how they look, right-click on a heading with the style applied and choose Edit Paragraph Style. In the window that appears, just make your changes and click OK.

Step 2: To Set Up the Table of Contents

  1. Click in your document where you want the table of contents to appear.
  2. Choose Insert > Indexes and Tables > Indexes and Tables.
    The Insert Index/Table window will appear.
  3. Check the number of levels you want to include. If you do not want all of them, change the Evaluate Up To Level setting.
  4. Be sure that the Outline checkbox is marked. Click the ... button next to it.
    The Outline/Numbering window will open up.
  5. Specify the paragraph styles you selected and applied in the previous major step, then click OK.
    If you used Heading1 through Heading10 it should already be set up correctly.
  6. Then click OK in the main tab and your table of contents will appear.

Step 3: To Modify the Table of Contents

If you do not like how the table of contents looks, modify the styles used to format the table of contents.

  1. Right-click on a line in the table of contents that you do not like and choose Edit Paragraph Style.
  2. In the window that appears, change the settings, then click OK.
    The table of contents will reflect those changes.

To update, edit, or delete the table of contents, right-click on it and choose Edit Index/Table.


See Also



This How To comes from Solveig Haugland's Blog

Content on this page is licensed under the Public Documentation License (PDL).