This is the 6th tip in a series of tips on Interactive PDFs. We’ve learnt in previous tips to create buttons, add cool roll over effects, add actions to buttons, create hyperlinks to pages and more. In this tip we’ll look at how we can create a Table of Contents in InDesign and automatically use the inclusion of an interactive Table of Contents during export to PDF as well as create navigational bookmarks in the PDF. The preparation as we’ll see is all on how we define and set-up our Table of Contents.
Rule number 1: In order to automatically generate a Table of Contents list in an InDesign document, you must use paragraph style consistently throughout your document.
So what do paragraph styles have to do with building a Table of Contents? Through-out your InDesign document (or document that is part of an InDesign Book), you use paragraph styles to format the text in the document. Styles such as “Heading1″, “Heading2″, “BodyText”, “Normal” and so on. Generally when we create a Table of Contents we want to create a copy of text, such as headings that is used through-out the document, or figure-names or table-names etc. InDesign’s Table of Contents feature can automatially filter out this text from an InDesign document IF you have formatted those headings with a unique paragraph style. Let’s say Heading1. Here’s how it all works together…
First of all, if you are looking at building a Table of Contents from different heading levels, consider how many levels deep you’d like the Table of Contents to be. For example will you only include “Heading 1″ text? Or do you want to see different levels, such as “Heading 1″ and “Heading 2″?
Once you’ve determine this think ahead a little. When the text is formatted in the Table of Contents:
Time to define your Table of Contents Style. From the Layout Menu choose Table of Contents Styles…
The Table of Contents Styles dialog appears. Click New… to define a new style.
Click the More Options button to see the full TOC dialog.
Let’s review this dialog top to bottom…
First of all we’ll name the Table of Content Style. Let’s say “Newsletter TOC”
The Title refers to the first bit of text that preceeds the contents listing itself. We’ll make this “In this week’s edition:”. The paragraph style next to it is the style used to format this text. We’ve created the “TOC_Title” style for this earlier.
Now we get to the good bits. Which text formatted with which paragraph style do you want to copy from the InDesign document into the Table of Contents? Answer in this example ChapterTitle_Black and ChapterTitle_White.
From the list of Other Styles you can select any of the paragraph styles that need to be included in the Table of Contents. To select multiple non-continuous styles hold down the Cmd (Mac) or Ctrl (PC) key as you are clicking style names. Press shift to select a continuous style range.
Next click the Add button to move the styles to the Include Paragraph Styles list.
InDesign automatically increments the Level numbers for each additional style included (up to 10 levels).
For each style listed set the correct level. As the ChapterTitle can appear in either Black or White I’ll set both to “Level 1″ in this example.
Now let’s go back to the list of questions we asked ourselves when designing the look of the Table of Contents.
Select each of the Included Paragraph Styles and set its settings for Entry Style, Page Number and Between Entry and Number
We’re almost done now…
When it comes to creating our Interactive PDF with interactive Table of Contents and PDF Bookmarks, we must enable the Create PDF Bookmarks option. Yep… you’re right… all this hard work and all we need to do is click this one button to get some extra interactivity in our PDF? Well kinda… we’ll still have create our Table of Contents in the document
Click OK twice to add the Table of Contents Style to the InDesign document.
Yay. Finally… we’re going to see our Table of Contents appear in the document.
Choose Layout > Table of Contents, and in the dialog select TOC Style created earlier in this example “Newsletter TOC” created and click OK.
The loaded text cursor appears containing all of the Table of Contents text. Click in the Table of Contents frame placed on the document page earlier or simply place the text wherever it needs placing.
And… ta da… There it is…
We’re now ready to test this rollover effect in the interactive PDF.
Choose a File > Adobe PDF Presets and select a PDF setting from the list of settings. Alternatively choose File > Export and set Format to PDF.
In the General section of the Export Adobe PDF dialog ensure the Bookmarks option is enabled for inclusion. Next click Export and generate the PDF.