Adding a table of contents element

You can create a table of contents to help readers navigate through lengthy documents.

Procedure

  1. Perform one of the following steps:
    • In the Palette view, select the Table of Contents icon Table of Contents element and drag it into the template content editor.
    • In the template content editor, right-click the place to insert an element, and then select Insert > Table of Contents icon Table Of Contents.
    • In the Outline view, right-click Content, and select Insert > Table of Contents icon Table Of Contents.
  2. Select the table of contents element.
  3. In the Properties view, select the Specific tab. Modify the table of contents properties:
    • For the Toc item level property, you can specify a number of heading levels the document has. Example: If you want the table of contents to include the H1, H2, and H3 section headings, but not the H4 section headings, enter 3.
    • For the Toc code, you can enter a script that automatically generates a heading styling for you.
  4. Click File > Save As or click the Save icon to save your changes.

What to do next

You can customize your table of contents by changing the default code, creating a variable that can be customized at run time, or creating stylesheets.

Creating table of contents code in Microsoft Word to use in Rational Publishing Engine

You can define the details for the table of contents structure in Microsoft Word and copy its code into a Rational® Publishing Engine template. Then, in Rational Publishing Engine, you can create the section titles and customize their formatting.

Before you begin

Specify the details for the table of contents structure in Microsoft Word:
  1. Enable field codes in Microsoft Word.
  2. Place your cursor in the editor.
  3. Insert a table of contents.
  4. In the Table of contents window, customize the details of your table of contents. You can choose to include page numbers with your headings, align the page numbers, and specify how many levels of section headings your document requires.
  5. Click OK. The table of contents code is displayed in the editor. Example: { \o "1-5" \h \z \u }
  6. Copy the code between the brackets. Example: \o "1-5" \h \z \u

Procedure

  1. Open Document Studio.
  2. In the Palette view, select the Table of Contents icon Table of Contents element and drag it into the template content editor.
  3. Select the table of contents element.
  4. In the Properties view, select the Specific tab.
  5. In the TOC code property, paste the table of contents code you copied from your Microsoft Word document.
  6. Save the changes.

Example

You can use Microsoft Word to specify the details for the table of contents, without creating the headings yet. After you retrieve the code for the table of contents details, you can paste it into Rational Publishing Engine and create the headings for the table of contents in Rational Publishing Engine. This example uses Microsoft Word 2007:

  1. In Microsoft Word 2007, enable field codes if they are not already displayed:
    1. Click the Start icon.
    2. Click Word Options > Advanced.
    3. In the Show document content section, select the Show field codes instead of their values check box.
    4. Click OK.
  2. Create the table of contents code:
    1. Click References tab.
    2. Click Table of Contents > Insert Table of Contents.
    3. In the Table of Contents tab, clear the Show page numbers check box. Clearing this selection prevents the page numbers from displaying in the table of contents.
    4. For Show levels, enter 4. This entry creates the levels of headings. Four levels creates Heading 1, Heading 2, Heading 3, and Heading 4.
    5. Click OK. The following code is displayed as the table of contents:{ TOC \o "1-4" \h \z \u }
    6. Copy the code between the brackets. Example: TOC \o "1-4" \h \z \u.
  3. Paste the code into the Rational Publishing Engine template:
    1. Open Document Studio.
    2. In the Palette view, select the Table of Contents icon Table of Contents element and drag it into the template content editor.
    3. Select the table of contents element.
    4. In the Properties view, select the Specific tab.
    5. In the TOC code property, paste the table of contents code copied from your Microsoft Word document.
    6. Click OK.
  4. In Rational Publishing Engine, create headings for each template section.
  5. Create heading styles.
  6. Apply the styles to the headings.
  7. Test the output.

Customizing a table of contents element by using a Microsoft Word document as a style sheet

Create a style sheet in Microsoft Word and then specify that style sheet in your document specification.

Procedure

  1. In the Microsoft Word, click Insert Table of Contents.
  2. Open the properties for the table of contents.
  3. In the Table of Contents tab, click Modify.
  4. In the Style window, click Modify.
  5. In the Modify Style window, customize the properties for the style. For example, to select the list item style:
    1. Click Format.
    2. Select the Numbering or Bullets tab.
    3. Choose a list item style.
    4. Click OK.
  6. Save the changes.
  7. In the Launcher application, specify the Microsoft Word document you created for the applicable output formats in your document specification.

Feedback