In PDF documents, the table of contents is generated automatically. For an item to be added to the table of contents, the following conditions must be met:

  • The item must be a value of an HTML heading tag.
  • The heading tag must be in the range from h1 to h6.
  • The heading tag needs to have the toc-item class assigned, e.g., <h1 class="toc-item">New heading</h1>.


Example of including a new heading in the table of contents

Let’s assume you want to add a new level 2 heading to the Comments Summary page and include it in the table of contents.


To add a new heading and include it in the table of contents


  1. Open the <template folder>/comment/comments-summary.html file.
  2. Add the h2 heading tag with its text at the required place.
  3. Add the toc-item class to the h2 element.
  4. If you want the heading to be at the bottom of the Comments Summary page, add it as an h2 element before the last closing div.

    …
    <h2 class="toc-item">1.3 New heading</h2>
    
    </div>
    </body>
    </html>


If document comments are exported using the updated template with the selected option to generate the table of contents, the new heading will be displayed on the Comments Summary page and included in the table of contents.


An example of the Comments Summary page with a new heading.


An example of the table of contents with a new heading.