Creating a Table of Contents

You can insert a table of contents into a single long document or into a master document. There are different procedures for each.

Quick, impulsive TOC insertion

If you just want to quickly insert a TOC (table of contents) now without fuss, just choose Insert > Indexes and Tables > Indexes and Tables. Make sure Table of Contents is selected twice in the lists, and that Entire Document is selected in the third list, then click OK.

graphics/09inf08.jpg

Note

In Writer, a table of contents is a type of "index." Index is the all-encompassing term for tables of contents, indexes, lists of figures, and so on. Debate the terminology all you want, but just know that any type of list with associated page numbers is created through a menu item called "Indexes" off the Insert menu.


Setting Up What's Included in the TOC

Make sure you've got the basicsheadingsplus anything else that should show up.

Standard Headings: The Key to TOCs

A table of contents is easiest to create if you've used styles for headings rather than just selecting plain text and manually making it big and bold. See Power Formatting With Styles on page 247 for more information on styles.

Make sure you've used paragraph styles for the headings in your document, such as Heading 1 or any that you've created. Heading styles are the basis of tables of contents; as long as you've used them, you're going to end up with something in your TOC.

Marking Special Table of Contents Entries

There may be instances where you want to include certain parts of a document in a table of contents. For example, say you're creating a table of contents that contains entries for Heading 1 and Heading 2 items only, but there's a single item at the Heading 4 level that is an extremely important section, and you want to include it in the table of contents as well. You can mark that item as a special entry for inclusion in the table of contents.

  1. In your document, select the text you want to include in the table of contents.

    In a master document, you need to select the text in the source file.

  2. Choose Insert > Indexes and Tables > Entry.

  3. In the Insert Index Entry window (Figure 9-16), select Table of Contents in the Index field.

    Figure 9-16. Marking special entries for inclusion in a table of contents

    graphics/09fig16.jpg

    The text you selected in the document shows up in the Entry field automatically.

  4. In the Level field, set the level of the item as it will appear in the table of contents.

  5. Click Insert.

  6. The Insert Index Entry stays open for you to select and insert more text in the document.

  7. When you're finished inserting special table of contents entries, click Close.

When you generate the table of contents, be sure that in the Insert Index window, on the Index tab, you select the Index marks option. If you don't, your special table of contents entries won't be included in the index.

Inserting a Table of Contents

Select the appropriate procedure depending whether you're working in a single standard document, or in a master document.

Inserting a Table of Contents Into a Standard Document

Use this procedure for inserting a table of contents into a single document rather than a master document. The procedure for inserting a table of contents into a master document follows this one.

Make sure you've used paragraph styles for the headings in your document, such as Heading 1 or any that you've created.

Also mark any text you want to include in the table of contents (see Marking Special Table of Contents Entries on page 333).

  1. Click in the document where you want to insert the table of contents.

  2. Choose Insert > Indexes and Tables > Indexes and Tables.

    In the Insert Index/Table window, set the options you want. The import sections are to select Table of Contents in both lists and, typically, to select Entire Document in the middle of the window.

  3. When you're finished, click OK.

To have more control over how it's generated, see Advanced Setup for Tables of Contents on page 336.

To format the paragraph styles in the table of contents, see Formatting and Editing a Table of Contents on page 339.

Figure 9-17. Setting table of contents options in the Insert Index window

graphics/09fig17.jpg

Note

Select Additional styles to include other-than-default paragraph styles in the table. Then click the ellipsis points button to set the additional styles; the Assign Styles window, shown in Figure 9-18, will appear.

Figure 9-18. Setting table of contents options in the Assign Styles window

graphics/09fig18.jpg


Inserting a Table of Contents Into a Master Document
  1. With the master document open, make sure Navigator is open (press the F5 key), and toggle to the master document view.

  2. In the Navigator window, select the file you want to put the table of contents before.

  3. In Navigator, click and hold down the Insert button, and choose Table of Contents.

  4. Set the options for the table of contents. If you need help setting options, see Inserting a Table of Contents on page 334.

  5. Click OK.

As in a single document, all parts of a table of contents have their own paragraph formats that you can modify. Click in a line of the table of contents, and the name of the style is highlighted in the Stylist under paragraph styles, as shown in Figure 9-22 on page 340.

Figure 9-22. Identifying styles used for table of contents levels

graphics/09fig22.jpg

To have more control over how it's generated, see Advanced Setup for Tables of Contents on page 336.

To format the paragraph styles in the table of contents, see Formatting and Editing a Table of Contents on page 339.

Advanced Setup for Tables of Contents

If you want to go beyond the quick TOC, here are some controls you can apply to what's in it, and how it looks.

Previewing the TOC

When you insert indexes and tables of contents, select the Preview option in the lower right corner of the Index tab, in the Insert Index/Table window. You'll see how the TOC or index will look with the current settings. An example is shown at right.

graphics/09inf09.jpg

Understanding the Table of Contents Formatting Codes

If you're the acronym type, think of it as CML (OpenOffice.org Complex Markup Language). When you select a table of contents level in the Entries tab (shown at right; see also Figure 9-19 on page 338), you can customize the way that level in the table of contents is displayed. Do this by working with the table of contents codes. Here's what each of the codes means.

  • <E#> If the paragraph level (for example, Heading 1) uses outline numbering, this tag inserts the full chapter number definition, whether it's 1, Chapter 1, or whatever.

    See Outline Numbering, for Chapter, Figure, and Cross-Reference Numbering on page 314.

  • <E> Inserts the text of the heading.

  • <T> Inserts a tab with leader dots. The tab distance and leader dots are defined in the paragraph styles used for table of contents entries, such as Contents 1, Contents 2, and so on.

  • <#> Inserts the page number.

  • <LS> and <LE> Opening and closing tags that enclose the part of the table of contents entry you want to hyperlink to its respective section of the document.

Figure 9-19. Defining what's in each level of a table of contents

graphics/09fig19.jpg

graphics/09inf10.jpg

Specifying Advanced Setup Options

Choose Insert > Indexes and Tables > Indexes and Tables. Then use the Assign Styles window in Figure 9-18. (In the Index/Table tab, click the browse icon (...) next to Additional Styles to get to the Assign Styles window.) Then use the Entries tab in Figure 9-19 to set additional options, if necessary.

Figure 9-20 explains the codes and how to set them up, and Figure 9-21 shows how to select the styles for the TOC.

Figure 9-20. Defining what's in each level of a table of contents

graphics/09fig20.jpg

Figure 9-21. Selecting the styles you want to be able to use in the table of contents

graphics/09fig21.jpg

To delete part of the structure section at the top, click on it and press Delete.

To add a chapter number, spot for entry text, tab stop, page number, or hyperlink, click in the part of the Structure area where you want it, and click the corresponding button.

Formatting and Editing a Table of Contents

A table of contents is typically a big block of read-only text that you can't edit directly (though you can change this effect in the first tab of the Insert Index window, shown in Figure 9-18 on page 337). Best practices are to regenerate the table of contents to change the text inside of it; because if you change just the table of contents entry, the heading used to generate it is still incorrect, and if you regenerate the table of contents for some reason, the incorrect heading will reappear.

In terms of formatting, you can change the formatting of the table of contents entries without regenerating the table of contents.

Basic Table of Contents Formatting

Each level in a table of contents has its own paragraph style. For example, level 1 headings by default are associated with the "Contents 1" paragraph style, which uses plain ol' vanilla formatting. To change the formatting of table of contents levels, modify their associated paragraph formats.

You can tell which paragraph style is associated with a level by clicking in a line of the table of contents. The paragraph style used for it will be highlighted in the Stylist, as shown in Figure 9-22.

For more information on modifying paragraph styles, see Standard Paragraph Styles on page 251.

Advanced Table of Contents Formatting

Instead of using and modifying the default paragraph table of contents styles, you can assign other paragraph styles to table of contents entries. Using this procedure you can also change the number of columns used for the table of contents, and you can add background color or graphics to the table of contents.

  1. Click in the table of contents, right-click, and choose Edit Index.

  2. In the Insert Index window, select the Styles tab. See Figure 9-23.

    Figure 9-23. Assigning paragraph styles to table of contents levels

    graphics/09fig23.jpg

    The Levels list displays the table of contents title and the 10 possible table of contents levels, with the paragraph styles that are assigned to those levels (in parentheses).

    The Paragraph styles list displays all the paragraph styles defined in the document.

  3. In the Levels list, select the item you want to assign a different paragraph format to.

  4. In the Paragraph styles list, select the paragraph style you want to assign to the selected level.

    You can't assign Writer's default Heading # styles to levels, but you can assign them to the table of contents title.

  5. Click the Assign button.

  6. Set column options in the Columns tab, and set background color or graphic options in the Background tab.

    These settings are similar to those used in defining page styles. If you need more information, see Figure 7-45 on page 237 for column information and Figure 7-44 on page 236 for background information.

  7. Click OK.

Fixing Page Flow After You Insert a Table of Contents or Adding New Content Before the Table of Contents

When you insert a table of contents above the content of your document, you may need to paginate your document so that the table of contents is by itself on one (or more) pages, and the body of your document starts on a new page. Figure 9-19 on page 338 shows a table of contents that is sitting right above the body of the document.

In a master document, you must use this procedure on the individual source files.

  1. Click at the beginning of the body of the document and press Ctrl+Enter to break the body to a new page.

  2. If you're using left and right page styles, and the table of contents ends on a right page, you may also need to click at the end of the table of contents and create a page break so that an empty left page is created.

    This lets you start the body of the document on a right page. See Applying and Switching Page Styles on page 259.

  3. After you change pagination, update the table of contents (next).

Editing a Table of Contents

Editing a table of contents involves tasks like including or excluding certain types of paragraph styles that are displayed, altering the way entries are displayed, associating levels with other-than-default paragraph formats, and making other fundamental changes to a table of contents.

If your basic table of contents setup is just as you want it, and you've simply added new content to your document, you only need to update the table of contents, not edit it. See Updating or Deleting a Table of Contents, next.

To edit a table of contents:

  1. Click in the table of contents.

  2. Right-click, and choose Edit Index.

  3. In the Insert Index window, make the changes you want. If you need help, see Figure 9-18, Figure 9-19, and Figure 9-23.

  4. Click OK.

Updating or Deleting a Table of Contents

If your page count changes, or you just don't want to have a TOC anymore, follow the steps in one of these procedures.

Updating a Table of Contents

If the contents or page count of a document changes after a table of contents has been generated, update the table of contents using this procedure.

However, if you need to make more fundamental changes to the table of contents structure, you need to edit the table of contents. See the previous procedure.

  1. Click in the table of contents.

  2. Right-click and choose Update Index.

Removing a Table of Contents

You can't remove a table of contents by selecting it and deleting it. To remove a table of contents, click in it, right-click, and choose Remove Index.



OpenOffice. org 1.0 Resource Kit
OpenOffice.Org 1.0 Resource Kit
ISBN: 0131407457
EAN: 2147483647
Year: 2005
Pages: 407

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net