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

Table of Contents

Next: , Previous: Headings and sections, Up: Structural markup elements

Table of contents

The table of contents is normally inserted directly before the first headline of the file. The depth of the table is by default the same as the number of headline levels, but you can choose a smaller number, or turn off the table of contents entirely, by configuring the variable org-export-with-toc, or on a per-file basis with a line like

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

If you would like to move the table of contents to a different location, you should turn off the default table using org-export-with-toc or #+OPTIONS and 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

Moreover, if you append ‘local’ parameter, the table contains only entries for the children of the current section1. In this case, any depth parameter becomes relative to the current level.

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

The same TOC keyword can also generate a list of all tables (resp. all listings) with a caption in the document.

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

The headline's title usually determines its corresponding entry in a table of contents. However, it is possible to specify an alternative title by setting ALT_TITLE property accordingly. It will then be used when building the table.


[1] For LaTeX export, this feature requires the titletoc package. Note that titletoc must be loaded before hyperref. Thus, you may have to customize org-latex-default-packages-alist.