How can I use the bs4
theme in bookdown, such as the one used for the R4DS book
In the _output.yaml
I see the following code, but it doesn't work with my project.
bookdown::bs4_book:
theme:
primary: "#637238"
repo: https://github.com/hadley/r4ds
includes:
in_header: [ga_script.html]
and I get this error when I attempt to build the book
Error: 'bs4_book' is not an exported object from 'namespace:bookdown'
Execution halted
I got it to work by doing the following:
Run the following
remotes::install_github("rstudio/bslib")
install.packages("downlit")
remotes::install_github("rstudio/bookdown")
Change the _output.yaml
to the following:
bookdown::bs4_book:
theme:
primary: "#637238"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With