我一直在研究ConnectorClient
中的一份报告,该报告有些冗长,并且想用r-markdown
分成几部分。我正在使用带有引导菜单栏的自定义html模板,该菜单栏在bookdown
的前部启用,并带有:
yaml
我的可复制示例产生以下错误:
html_document中的错误(fig_width = fig_width,fig_height = fig_height, :指定“ toc_float”选项时必须使用主题 调用:...->基本格式->输出格式-> html_document
当我包含toc: true
toc_float: true
时,出现此错误:
html_document中的错误(fig_width = fig_width,fig_height = fig_height, :正式参数“主题”与多个实际参数匹配 通话:... do.call->-> base_format-> output_format
该文档在没有theme: default
的情况下进行编织,但是我的引导菜单栏消失了(如设计那样)。
有什么想法吗?
toc_float
---
title: "test doc"
output:
bookdown::html_document2:
# theme: default
base_format: rmarkdown::html_vignette
toc: true
toc_float: true
---
```{r child = "chapters/01-child.Rmd"}
```
答案 0 :(得分:1)
如果我正确理解这一点,则toc_float无法与rmarkdown::html_vignette
一起使用,因为您无法设置主题。
摘自rmarkdown::html_vignette
的文档:
其他参数传递给html_document。请注意,主题,fig_retina和Highlight是硬编码的。设置任何这些都会产生错误。 [...]
与html_document相比,它:
- 从不使用视网膜图形
- 从不使用主题
但是,可能的解决方案可能是从html_vignette
切换到html_document
:
output:
html_document:
toc: true
toc_depth: 3
toc_float: true