R 如何在bookdown中使用新的bs4()主题?
如何在bookdown中使用R 如何在bookdown中使用新的bs4()主题?,r,r-markdown,bookdown,R,R Markdown,Bookdown,如何在bookdown中使用bs4主题,例如用于 在\u output.yaml中,我看到了以下代码,但它不适用于我的项目 bookdown::bs4_book: theme: primary: "#637238" repo: https://github.com/hadley/r4ds includes: in_header: [ga_script.html] 当我试图建立这本书时,我得到了这个错误 Error: 'bs4_book' is n
bs4
主题,例如用于
在\u 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
我通过以下操作使其工作:
bookdown::bs4_book:
theme:
primary: "#637238"
运行以下命令
remotes::install_github("rstudio/bslib")
install.packages("downlit")
remotes::install_github("rstudio/bookdown")
将\u output.yaml
更改为以下内容:
bookdown::bs4_book:
theme:
primary: "#637238"
通过从github repo安装开发版本:您是否安装了包含书籍格式代码的
R4DS
包?您可以通过devtools::install\u github(“hadley/r4ds”)
@DirkEddelbuettel安装它,谢谢bookdown
对于构建文档,bslib
对于bookdown::bs4\u book
本身和downlit
由于错误:必须安装以下软件包才能使用bs4\u book()*downlit
。我认为下面这行就足够了,devtools::install\u github('rstudio/bookdown@bs4-书本编码',force=TRUE)