```{r}
#| unilur-solution: true
1 + 1
```
[1] 2
format:
unilur-html: default
unilur-html+solution:
# You have to specify a different output file otherwise they will
# overwrite themselves
output-file: example-solution.html
When you call quarto render
, two HTML files will be produced. The one named example-solution.html
will have the solution blocks included.
unilur-solution
Boolean and the global option show-solution
in the YAML header.Of note, if show-solution
is absent, it is considered false
.
unilur-solution: true
echo: fenced
```{r}
1 + 1
```
[1] 2
unilur-collapse: false
Any machinery supported by Quarto can be used:
unilur-solution: true
#| unilur-solution: true
for i in [3, 5, 6]:
print(i)
Caution callouts are classic:
Red expected
But tip ones are using a yellow color to better discriminate with the new solution blocks:
Are yellow instead of green-ish (in HTML)
{block}
):You can also include div
labels with unilur-solution
. Note the solution will only show up in the solution file (collapsed box).
The advantage of working inside the div labels is that standard code formatting and highlighting will apply, and code can be executed alongside standard text.