title: How to set Sphinx and latexpdf toc depth?
body: <p>I have a vanilla sphinx project (Sphinx 1.2b3.) created with "sphinx-quickstart"</p>
  
  <p>I add a basic page.rst with 4 header levels.</p>
  
  <p>I can control the depth of the html toc in index.rst:</p>
  
  <pre><code>.. toctree::
     :maxdepth: 1
     :numbered:
  
     page
  </code></pre>
  
  <p>Based upon the documentation <a href="http://sphinx-doc.org/latest/markup/toctree.html" rel="noreferrer">http://sphinx-doc.org/latest/markup/toctree.html</a> I adjust the conf.py as follow:</p>
  
  <pre><code>ADDITIONAL_PREAMBLE = """
  \setcounter{tocdepth}{1}
  """
  
  latex_elements = {
  # The paper size ('letterpaper' or 'a4paper').
  'papersize': 'a4paper',
  
  # The font size ('10pt', '11pt' or '12pt').
  #'pointsize': '10pt',
  
  # Additional stuff for the LaTeX preamble.
  'preamble': '\setcounter{tocdepth}{1}'
  #'preamble': ADDITIONAL_PREAMBLE
  }
  </code></pre>
  
  <p>Then I build:</p>
  
  <pre><code>$ make clean
  $ make html
  $ make latexpdf
  </code></pre>
  
  <p>The html show only level 1 as expected but the pdf keeps showing 2 toc levels - screen shoot <img src="https://i.stack.imgur.com/naK8r.png" alt="enter image description here">:</p>
  
  <p>Any hints?</p>
  
  <p>thx</p>
  
  <p>pelle</p>
  
  <h1>solution</h1>
  
  <p>was provided by jacob -> simply think required level num -1:</p>
  
  <pre><code>'preamble': '\setcounter{tocdepth}{0}'
  </code></pre>