I'm a complete bookdown newbie, but I'm interested in having collapsable and customisable boxes like those in the unilur package in my bookdown document but I'm having trouble combining the two though.
This works in a normal Rmarkdown document:
---
title: "Untitled"
output: unilur::tutorial_html_solution
---
```{r}
library(unilur)
```
```{block, box.title = "You can add a title", box.body = list(fill = "lightblue"), box.header = list(fill = "red", colour = "white")}
A custom box
```
But when I try to run the same code in a bookdown document it doesn't work as expected.
Here is the code I'm trying in a fresh bookdown template that you get when starting a bookdown project in Rstudio. My index.Rmd looks like this (nothing else is changed):
---
title: "A Minimal Book Example"
output: unilur::tutorial_html_solution
site: bookdown::bookdown_site
---
# Test heading
```{r}
library(unilur)
```
```{block, box.title = "You can add a title", box.body = list(fill = "lightblue"), box.header = list(fill = "red", colour = "white")}
A custom box
```
I can render the book using:
bookdown::render_book("index.Rmd", "bookdown::gitbook")
or
bookdown::render_book("index.Rmd", "unilur::tutorial_html_solution")
but they both don't work in different ways. In the first, the block doesn't get formatted (but the text shows) and using the second, the block gets formatted as expected, but the book becomes one long concatenated document (as far as I can tell).