简体   繁体   English

如何在R Bookdown(GitBook)中更改TOC深度?

[英]How to change TOC depth in R Bookdown (GitBook)?

I use GitBook format through R bookdown . 我通过R bookdown使用GitBook格式。 I need to use at least four levels in the table of contents (TOC). 我需要在目录(TOC)中至少使用四个级别。 The default is three. 默认值为3。 How can I change the depth of TOC? 如何更改TOC的深度?


UPDATE UPDATE

Now the toc-related contents of my _output.yml file look like this: 现在我的_output.yml文件的toc相关内容如下所示:

bookdown::gitbook:
  config:
    toc_depth: 4
    toc:
      collapse: section
      scroll_highlight: yes
      before: |
        <li><a href="../index.html"><b>Main</b></a></li>
      after: |
        <li><a href="../index.html"><b>Main</b></a></li>

config: toc_depth: 4 does not work. config: toc_depth: 4不起作用。

Try adding the following to your _output.yml file: 尝试将以下内容添加到_output.yml文件中:

bookdown::gitbook:
    toc_depth: 2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM