This is the official manual for the latest Org-mode release.
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
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
#+OPTIONS and insert
#+TOC: headlines N at the desired
#+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
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
ALT_TITLE property accordingly. It will then be used when
building the table.
 For LaTeX export,
this feature requires the
titletoc package. Note that
must be loaded before
hyperref. Thus, you may have to