This is the official manual for the latest Org-mode release.

Table of Contents

Next: , Previous: Export settings, Up: Exporting


12.3 Table of contents

Org normally inserts the table of contents directly before the first headline of the file. Org sets the TOC depth the same as the headline levels in the file. Use a lower number for lower TOC depth. To turn off TOC entirely, use nil. This is configured in the org-export-with-toc variable or as keywords in an Org file as:

     #+OPTIONS: toc:2          only include two levels in TOC
     #+OPTIONS: toc:nil        no default TOC at all

To move the table of contents to a different location, first turn off the default with org-export-with-toc variable or with #+OPTIONS: toc:nil. Then insert #+TOC: headlines N at the desired location(s).

     #+OPTIONS: toc:nil        no default TOC
     ...
     #+TOC: headlines 2        insert TOC here, with two headline levels

To adjust the TOC depth for a specific section of the Org document, append an additional ‘local’ parameter. This parameter becomes a relative depth for the current level.

Note that for this feature to work properly in LaTeX export, the Org file requires the inclusion of the titletoc package. Because of compatibility issues, titletoc has to be loaded before hyperref. Customize the org-latex-default-packages-alist variable.

     * Section #+TOC: headlines 1 local insert local TOC, with direct children
     only

Use the TOC keyword to generate list of tables (resp. all listings) with captions.

     #+TOC: listings           build a list of listings
     #+TOC: tables             build a list of tables

Normally Org uses the headline for its entry in the table of contents. But with ALT_TITLE property, a different entry can be specified for the table of contents.