r-如何在bookdown中使用新的bs4()主题



如何在bookdown中使用bs4主题,例如用于R4DS书籍的主题

_output.yaml中,我看到了以下代码,但它不适用于我的项目。

bookdown::bs4_book:
theme:
primary: "#637238"
repo: https://github.com/hadley/r4ds
includes:
in_header: [ga_script.html]

当我试图构建这本书时,我遇到了这个错误

Error: 'bs4_book' is not an exported object from 'namespace:bookdown'
Execution halted

我通过以下操作使其工作:

运行以下

remotes::install_github("rstudio/bslib")
install.packages("downlit")
remotes::install_github("rstudio/bookdown")

_output.yaml更改为以下内容:

bookdown::bs4_book:
theme:
primary: "#637238"

最新更新