Documentation/OOoAuthors User Manual/Writer Guide/Creating a table of contents

From Apache OpenOffice Wiki
Jump to: navigation, search



Creating a table of contents

Writer’s table of contents feature lets you build an automated table of contents from the headings in your document. Before you start, make sure that the headings are styled consistently. For example, you can use the Heading 1 style for chapter titles and the Heading 2 and Heading 3 styles for chapter subheadings.

This section shows you how to:

  • Create a table of contents quickly, using the defaults.
  • Customize a table of contents.

Note: You can use custom styles for the different levels in the table of contents as well. This document uses the default styles for simplicity.


Creating a table of contents quickly

Although tables of contents can be customized extensively in Writer, most of the time you will probably find the default to be fine. Creating a quick table of contents is simple:

  1. When you create your document, use the following paragraph styles for different heading levels (such as chapter and section headings): Heading 1, Heading 2, and Heading 3. These are what will appear in your table of contents. You can use more levels of headings, but the default setting is to use only the first three levels in the table of contents. It could look like the figure below if you used the default styles.
  2. Headings example
    Headings example.

  3. Place the cursor where you want the table of contents to be inserted.
  4. Select Insert > Indexes and Tables > Indexes and Tables.
  5. Change nothing in the Insert Index/Table dialog box. Click OK. The result will look like the figure below.
  6. Table of contents example
    Table of contents example.

If you add or delete text (so that headings move to different pages) or you add, delete, or change headings, you need to update the table of contents. To do this:

  1. Place the cursor within the table of contents.
  2. Right-click and select Update Index/Table from the pop-up menu.

Note: If you cannot place your cursor in the table of contents, choose Tools > Options > OpenOffice.org Writer > Formatting Aids, and then select Enable in the Cursor in protected areas section.

Tip: You can customize an existing table of contents at any time. Right-click anywhere in it and select Edit Index/Table from the pop-up menu. Continue as described in the next section, Customizing a table of contents.

Customizing a table of contents

To insert a customized table of contents into your document:

  1. Place the cursor where you want to insert the table of contents.
  2. From the main menu, choose Insert > Indexes and Tables > Indexes and Tables. The Insert Index/Table dialog box opens.

Index/Table page of Insert Index/Table dialog box
Index/Table page of Insert Index/Table dialog box.

The Insert Index/Table dialog box has five pages. Any or all of them can be used when creating or editing a table of contents:

  • Use the Index/Table page to set the attributes of the table of contents.
  • Use the Entries and Styles pages to format the entries in the table of contents.
  • Use the Columns page to put the table of contents into more than one column.
  • Use the Background page to add color or a graphic to the background of the table of contents.

You can display a preview box, located on the left-hand side of each tab, to show as you work how the table of contents will look. (If you do not see the preview box, select the Preview checkbox in the lower right-hand corner of the dialog box.) The illustrations in this chapter show the dialog box as it appears with the preview box hidden.

After making all your changes, click OK to save the table of contents so it appears in your document.

Using the Index/Table page

Use the Index/Table page to set the attributes of the table of contents.

Adding a title

To give the table of contents a title, type it in the Title field. (You can change an existing title by typing over it.) To delete the title, clear the Title field.

Setting the type of index

You can create several types of indexes. They include:

  • Table of Contents
  • Alphabetical Index
  • Illustration Index
  • Table of Objects
  • Bibliography

You can also create user-defined indexes.

Template:Documentation/Note

Choosing the scope of the table of contents

From the for drop-down list in the Create index/table area, select Entire document. There is an additional option to create a table of contents for just the current chapter. For more information, refer to Help > OpenOffice.org Writer > Contents.

Creating a table of contents from an outline

This selection creates the table of contents using outline levels; that is, paragraphs formatted with one of the predefined heading styles (Heading 1-10) are added to the table of contents in order.

Click on the (...) button next to the checkbox to change the numbering properties of the table of contents. This can be useful if you want to put numbers in front of each level of the contents, as shown below.

Table of contents with numbers
Table of contents with numbers.

Creating from index marks

This selection adds any index entries that you have inserted into the document by using Insert > Indexes and Tables > Entry. Normally you would not use this selection for a table of contents.

Protecting against manual changes

To stop the table of contents being changed accidentally, select the Protected against manual changes option. If this option is seleced, the table of contents can only be changed using the context menu or the Insert Table/Index dialog box. If the option is not selected, the table of contents can be changed directly on the document page, just like other text.

Template:Documentation/Tip

Changing the number of levels included

Writer displays a default setting of 10 levels of headings when it builds the table of contents (or the number of levels used in the document, whichever is smaller). To change the number of levels, enter the required number in the Evaluate up to level box.

Creating from additional styles

Writer automatically assigns to the table of contents all paragraphs formatted with the default heading styles (Heading 1, Heading 2, and so on). To assign paragraphs formatted with other styles, including custom styles:

  1. In the Create from area, select the Additional Styles checkbox.
  2. Click the (...) button to the right of the checkbox. The Assign Styles dialog box opens.
  3. Assign Styles dialog box
    Assign Styles dialog box.

  4. In the Not applied column, click the style that you want to assign to the table of contents.
  5. Use the >> button to move the selected style to the desired outline level. For example, to have paragraphs formatted with the selected style to appear as top-level entries in the table of contents, click the >> button once to move the style into the 1 column. To move the style in the opposite direction, use the << button.
  6. Click OK to save your changes and return to the Index/Table tab or click Cancel to return without saving your changes.

Template:Documentation/Note

Using the Entries page

Use the Entries page to define and format the entries in the table of contents. For each outline level, you can add and delete elements such as chapter (heading) numbers, and you can also apply character styles to individual elements.

Entries page of Insert Index/Table dialog box
Entries page of Insert Index/Table dialog box.

To begin, click a level number in the Level column to select the outline level whose elements you want to format. (You will be able to apply changes to all outline levels later.) The Structure line displays the elements for entries in that level. Each button on the Structure line represents one element:

  • The E# button represents the “chapter number”, which means the heading number, not just for chapters but also for other levels of headings.
  • The E button represents the entry text.
  • The T button represents a tab stop.
  • The # button represents the page number.
  • The LS button represents the start of a hyperlink. (This button does not appear on the default Structure line.)
  • The LE button represents the end of a hyperlink. (This button does not appear on the default Structure line.)

Each white field on the Structure line represents a blank space. You can add custom text if you desire.

Template:Documentation/Note

Template:Documentation/Note

Changing elements

To change an element in the Structure line, click the button representing that element and then click the element that you want to substitute in the row of buttons just below the Structure line. For example, to change a chapter number to a tab stop, click the E# button on the Structure line (it shows then as being pressed) and then click the Tab stop button in the row of available elements.

Deleting elements

To delete an element from the Structure line, click the button representing that element and then press the Delete key on your keyboard. For example, to delete a tab stop, click the T button and then press the Delete key.

Adding elements

To add an element to the Structure line:

  1. Place the cursor in the white field to the left of where you want to insert the element.
  2. Click one of the five buttons just below the Structure line. (For example, to add a tab stop, click the Tab stop button.) A button representing the new element appears on the Structure line.
  3. If you want to add a space (for example, between E# and E), click in the white field between the two elements and type your space. The same concept works for any text you may want to add.

Hyperlinking an entry

To change the default Structure line so that the chapter number and the entry text form a hyperlink, follow these steps:

  1. On the Structure line, place the cursor in the white field to the left of the E# button.
  2. Click the Hyperlink button. An LS button, representing the start of the hyperlink, appears on the Structure line.
  3. On the Structure line, place the cursor in the white field to the right of the E button.
  4. Click the Hyperlink button again. An LE button, representing the end of the hyperlink, appears on the Structure line.

The figure below represents the completion of the above steps. The number and the text of the entries on that level will now be hyperlinks.

Hyperlink in table of contents
Hyperlink in table of contents.

Applying character styles

To apply a character style to an element:

  1. On the Structure line, click the button representing the element to which you want to apply a style.
  2. From the Character Style drop-down list, select the desired style. Writer applies the selected style to the selected element.

To view or edit the attributes of a character style, select the style from the Character Style drop-down list and then click the Edit button.

Template:Documentation/Tip

Applying changes to all outline levels

To apply the displayed structure and formatting to all outline levels, click the All button.

Tab position relative to Paragraph Style indent

When this checkbox is selected, entries are indented according to the settings of their individual formats. Where a paragraph style with an indent on the left is in use, tab stops will be relative to this indent. If this checkbox is not selected, tab stops will be relative to the left margin position.

Using the Styles page

Use the Styles page to apply paragraph styles to the table of contents. You can apply a different paragraph style to each outline level of the table.

Styles page of Insert Index/Table dialog box
Styles page of Insert Index/Table dialog box.

To apply a paragraph style to an outline level:

  1. In the Levels list box, select the desired outline level by clicking it.
  2. In the Paragraph Styles list box, click the paragraph style to apply.
  3. Click the < button to apply the selected paragraph style to the selected outline level.

The styles of the level appears in the square brackets in the Levels list.

To remove paragraph styling from an outline level:

  1. In the Levels list box, select the desired outline level by clicking it.
  2. Click the Default button.

To view or edit the attributes of a paragraph style, click the style in the Paragraph Styles list box and then click the Edit button.

Template:Documentation/Note

Using the Columns page

Use the Columns page to change the number of columns for the table of contents.

Columns page of the Insert Index/Table dialog box
Columns page of the Insert Index/Table dialog box.

Adding multiple columns

To display the table of contents in more than one column:

  1. Either enter the number of columns desired in the box labeled Columns or select the icon representing the number of columns.
  2. To evenly distribute the columns according to the page width, check the AutoWidth box. If it is unchecked, you can manually set each of the following by altering the associated spin box:
    • Width between each of the columns
    • Spacing between each of the columns
  3. You can choose to have a separator line between the columns:
    • Line: The width of the line.
    • Height: The height of the line.
    • Position: Relative position of the line to the table (top, middle, or bottom) if the height is less than 100%.

Using the Background page

Use the Background page to add color or a graphic to the background of the table of contents.

Adding color

To add color to the background of the table of contents, select from the color grid.

Template:Documentation/Note

Background page of Insert Index/Table dialog box
Background page of Insert Index/Table dialog box, showing Color choices.

Adding a graphic

To add a graphic to the background of the table of contents:

  1. From the As drop-down list, select Graphic. The Background tab now displays the graphics options, as shown below.
  2. Click the Browse button. The Find graphics dialog box opens.
  3. Find the graphic file you want and then click the Open button. The Find graphics dialog box closes and the selected graphic appears in the graphic preview box on the right-hand side of the Background tab. (If you do not see the graphic, select the Preview checkbox.)
  4. To embed the graphic in your document, clear the Link checkbox. To link the graphic to the document but not embed it, select the Link checkbox.
  5. In the Type area of the Background tab, choose how you want the background graphic to appear:
    • To position the graphic in a specific location, select Position and then click the desired location in the position grid.
    • To stretch the graphic to fill the entire background area, select Area.
    • To repeat the graphic across the entire background area, select Tile.

Graphic options on the Background page
Graphic options on the Background page of the Insert Index/Table dialog box.

Deleting color or graphics

To delete color or graphics from the table background:

  1. From the As drop-down list, select Color.
  2. Click No Fill on the color grid.

Maintaining a table of contents

This section shows you how to:

Editing a table of contents

To edit an existing table of contents:

  1. Click anywhere in the table of contents and then right-click.
  2. Template:Documentation/Tip

  3. From the pop-up menu, choose Edit Index/Table. The Insert Index/Table dialog box opens and you can edit and save the table as described in the previous section.

You can also access the Index/Table dialog box from the Navigator.

  1. Open the Navigator (press F5).
  2. Click the + sign next to Indexes.
  3. Right-click on the desired index.
  4. Select Index > Edit.

Access an index from the Navigator
Access an index from the Navigator.

Updating a table of contents

Writer does not update the table of contents automatically, so after any changes to the headings, you must update it manually. To update a table of contents when changes are made to the document:

  1. Click anywhere in the table of contents and then right-click.
  2. From the pop-up menu, choose Update Index/Table. Writer updates the table of contents to reflect the changes in the document.

Template:Documentation/Note

Deleting a table of contents

To delete the table of contents from a document:

  1. Click anywhere in the table of contents and then right-click.
  2. From the pop-up menu, choose Delete Index/Table. Writer deletes the table of contents.

Template:Documentation/Note

You can also delete the index from the Navigator by selecting Index > Delete from the menu.

Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools