title: How to change TOC depth in R Bookdown (GitBook)?
body: <p>I use <em>GitBook</em> format through <em>R</em> <em>bookdown</em>. I need to use at least four levels in the table of contents (TOC). The default is three. How can I change the depth of TOC?</p>
  
  <hr>
  
  <p>UPDATE</p>
  
  <p>Now the toc-related contents of my <code>_output.yml</code> file look like this:</p>
  
  <pre><code>bookdown::gitbook:
    config:
      toc_depth: 4
      toc:
        collapse: section
        scroll_highlight: yes
        before: |
          &lt;li&gt;&lt;a href="../index.html"&gt;&lt;b&gt;Main&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
        after: |
          &lt;li&gt;&lt;a href="../index.html"&gt;&lt;b&gt;Main&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p><code>config: toc_depth: 4</code> does not work.</p>