Controlling messages globally #15116
DescriptionI'm trying to control messages globally in my document ---
title: "My Document"
format: html
execute:
message: false
---
```{r}
message("This is a message") # shown
```
This will print the message, even though it was told not to. I can turn of messages by setting warning: false ---
title: "My Document"
format: html
execute:
warning: false
---
```{r}
message("This is a message") # hidden
```For individual chunks, there is separate control of messages and warnings, but this seems not to be the case globally. Is there something I have missed? This is with quarto version ‘1.10.18’ |
Replies: 1 comment
|
---
title: "My Document"
format: html
knitr:
opts_chunk:
message: NA
---With |
messageisn't a valid option underexecute:, so Quarto ignores it.At the document level,
warningcontrols both warnings and messages, which is whywarning: falsehides your message.The options you can set under
execute:are listed in the documentation: https://quarto.org/docs/computations/execution-options.html#output-optionsmessageis specific to knitr, and the Jupyter and Julia engines have no equivalent, so it isn't a sharedexecute:option.#| message: falseworks on a single cell because knitr handles the cell options itself.To set it for the whole document while you keep warnings, you can pass it to knitr directly: