How to hide paragraphs conditionally in bookdown?

For example, bookdown provides exercise environment.

```{exercise}
exer1
\```  

and solutions environment:

```{solution}

solution here
$formulas$
- list1
- list2, etc.
\```
  1. Before distributing the document (pdf) to students, I need to hide the solution environments.

  2. and, solution environments should probably not appear in HTML output.

is there a way like

```{solution, hide=boolean_variable}
solution here
$formulas$
- list1
- list2, etc.
\```

I have just found a trunk option "include=0", it works.
Ref: Options - Chunk options and package options - Yihui Xie | 谢益辉

```{solution  include=FALSE}
solution here
$formulas$
- list1
- list2, etc.
\```

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.