Bookdown:未编号的部分不再折叠
我的书本文档的折叠发生了意外的变化。我通过 bookdown 演示验证了这一点。
bookdown::gitbook:
css: style.css
split_by: section
number_sections: false
toc_depth: 3
config:
toc:
collapse: section
通过上述设置,目录中的所有部分都不会折叠。
使用 number_sections: true
时,只有编号的部分会折叠,任何未编号的部分(使用 {-}
)都不会折叠。
The collapsing of my bookdown document changed unexpectedly. I verified this with the bookdown demo.
bookdown::gitbook:
css: style.css
split_by: section
number_sections: false
toc_depth: 3
config:
toc:
collapse: section
With the above settings, all sections are uncollapsed in the TOC.
With number_sections: true
, only numbered sections collapse, any unnumbered ones (using {-}
) won't collapse.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我昨天注意到了同样的行为(bookdown::gitbook toc 的未编号部分不会折叠到之前的位置)。在探索 _output.yml 文件中的变体之后,我将 rmarkdown 包回滚到 v2.11(从 v2.13)并解决了问题。
I noticed the same behavior yesterday (unnumbered sections of bookdown::gitbook toc would not collapse where they had previously). After exploring variants in my _output.yml file, I rolled back my rmarkdown package to v2.11 (from v2.13) and it fixed the issue.