【发布时间】:2018-09-13 15:19:23
【问题描述】:
我想为一个 bookdown 项目编写一个自定义模板。从 bookdown 包的documentation 中,我读到可以用自定义模板替换默认模板,比如my_custom_template.html,方法是在 YAML 标头中包含template: "my_custom_template.html",如
bookdown::gitbook:
template: my_custom_template.html
这样做会产生以下错误:
Error in rmarkdown::html_document(..., extra_dependencies = c(extra_dependencies, :
formal argument "template" matched by multiple actual arguments
Calls: <Anonymous> ... do.call -> <Anonymous> -> html_document2 -> <Anonymous>
Execution halted
Error in eval(expr, envir, enclos) :
Failed to compile the book to bookdown::gitbook
在我看来,默认模板是硬编码的,因此不能那么容易地覆盖。
还有其他方法可以包含自定义模板吗?
【问题讨论】:
标签: r r-markdown pandoc bookdown