I can create table of contents in two ways:
.. contents is a doctutils directive (the underlying library which defines ReST and associated utilities) and automatically generates a table of contents from headlines within the current topic.
.. toctree is a Sphinx-defined directive in which you explicitly list documents whose TOCs will be listed out.
.. contents for example within a document to generate an overview of contents within the page, e.g.:
=================== Curing World Hunger =================== .. contents:: :depth: 1 Abstract ======== … Problem description =================== …
.. toctree within an index document which contains basically nothing else:
================= Scientific papers ================= Below is a list of papers published here: .. toctree:: :maxdepth: 2 curing_hunger …
.. toctree takes a list of documents to process,
.. contents does not.