I have the following code chunk in a qmd file which is a chapter in a Quarto book.
```{r}
#| echo: false
message("Error in library(tidyverse) : there is no package called ‘tidyverse’", )
```
When the chapter is rendered, this message appears in black. I would like it to appear in red, since that would be the color a student sees when she actually encounters this error.
How can I change the color outputed from a single R code chunk?
Thanks for the reply! That works for pdf output, as you note. But it does not work for html output, which is my use case. (Apologies for not specifying that before.) But the link you kindly provide gives me the answer:
<span style="color: red;">Error in library(tidyverse) : there is no package called 'tidyverse'</span>