title: jupyter nbconvert --to html_toc not working (convert jupyter notebook with table of content to website format)
body: <h1>What I wanted</h1>
  <p>With the nbextension <a href="https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/toc2/README.html" rel="nofollow noreferrer">toc</a>, jupyter notebooks have table of content capabilities which is said to be transferable to html via <a href="https://nbconvert.readthedocs.io/en/latest/usage.html#convert-html" rel="nofollow noreferrer">nbconvert --to html_toc function</a>, or via the dropdown menue &quot;download as html with toc&quot;. However, neither option works in my case.</p>
  <h1>What I have tried</h1>
  <ol>
  <li>Download as html with toc initially gave an error similar to TemplateNotFound: toc2</li>
  <li>All recommended commands like
  <code>jupyter nbconvert FILE.ipynb --template toc</code>
  <code>jupyter nbconvert FILE.ipynb --template toc2</code> (These two appear to be incomplete but are supplied like this)
  <code>jupyter nbconvert --to html_toc FILE.ipynb</code> (same error as above via menue)</li>
  <li>As <a href="https://stackoverflow.com/questions/61658289/how-to-set-the-argument-template-toc2-through-nbconvert-api">here</a> and <a href="https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/toc2/README.html" rel="nofollow noreferrer">here</a> the toc2.tpl file is mentioned, I placed this file together with the main.css and toc2.js file into the same directory as the ipynb notebook to be converted. Now the download as html with toc menue gives error &quot;nbconvert failed: toc2&quot; and the <code>jupyter nbconvert FILE.ipynb --template toc2</code> gives error &quot;jinja2.exceptions.TemplateNotFound: toc2&quot;
  I still have not understood the role of the toc2 template. Is it (still) necessary? Why? How (with the other files?)? Where (how is the location provided)? What exactly is needed where and how to make use of this extremely usefull functionality?</li>
  <li>The downgrade mentioned <a href="https://stackoverflow.com/questions/65376052/jupyter-notebook-download-as-html-toc-error">here</a> was not possible due to resulting incompab.</li>
  </ol>
  <h1>Used Conditions / Versions in conda virtual environment</h1>
  <p>(Please tell me if you need more information)</p>
  <pre><code>jupyter core     : 4.7.1
  jupyter-notebook : 6.2.0
  qtconsole        : 5.0.2
  ipython          : 7.20.0
  ipykernel        : 5.3.4
  jupyter client   : 6.1.7
  jupyter lab      : 3.0.8
  nbconvert        : 6.0.7
  ipywidgets       : 7.6.3
  nbformat         : 5.1.2
  traitlets        : 5.0.5
  </code></pre>