How do I create the table of contents in PDF file?

If you click on Think Python 2e, you’ll notice the table of contents on the left side. Clicking on the subheading will take you to that section in the book.

How do I create the table contents in LibreOffice Writer and have it appear on the left side, with the same functionality, when I create a PDF?

This is done automatically when you export to PDF unless you changed TOC parameters.

First condition to get a “correct” TOC in Writer is to style all your chapter, sub-chapter, … headings with the Heading n paragraph style family. Chapter heading is formatted with Heading 1, sub-chapter with Heading 2, etc.

The TOC must not be created manually, otherwise Writer does not know it is a TOC. Use Insert>Indexes & Tables>Index, TOC or Bibilography. The Heading n paragraphs are collected to make the TOC.

By default, TOC entries will contain hyperlink to jump back to the headings. These links are forwarded to the PDF.

More information on the style system can be found in the Writer Guide.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In the Export dialog, select the tab Initial View and, under Panes, tick the option control Bookmarks and page