# Add page break after tableofcontent via preamble?

Is it possible to add a page break after the table of contents in the preamble rather than inline in the .tex file?

This question is somewhat related to the other one I asked here, though since it's a different question I thought I should do another post.

Basically I'm using Sphinx with Read the Docs, so I don't have access to the generated .tex file before it's processed into a PDF, meaning I have to make any changes I do to the preamble section.

My current doc class is "report", but the content starts on the same page as the last partial page of the table of contents, whereas I'd like to start it on the next page if that's possible?

Here's what I'm adding to the preamble so far from my Sphinx config file:

    \renewcommand\thesection{\hspace*{-0.5em}}
\renewcommand\thesubsection{\hspace*{-0.5em}}
\usepackage{bera}
\usepackage[defaultsans]{lato}
\usepackage{inconsolata}
\usepackage{ragged2e}
\AtBeginDocument{\raggedright}
\setcounter{tocdepth}{1}
\pagenumbering{arabic}


Thanks! Brian

• \renewcommand\thesection{\hspace*{-0.5em}} eeek! really? – David Carlisle Dec 1 '16 at 19:12
• \let\oldtablefocontents\tableofcontents \renewcommand\tableofcontents{\oldtableofcontents\clearpage} – David Carlisle Dec 1 '16 at 19:13
• it shouldn't make the toc go, it just adds \clearpage to the end of the definition. presumably your method of removing section numbers was incorrect should just be \setcounter{secnumdepth}{0} – David Carlisle Dec 1 '16 at 19:52

Then I realized that Sphinx has an option for latex where you can set toctree_only=True which means that it will ignore text content from your master doc and only use the TOC from it, and when I set that, it fixes the problem. The first doc starts on the next page. So I'm going to call this 'answered' now.
• perhaps you could use something like .. only:: not latex in the master doc file. – user4686 Jun 20 '17 at 22:05