You can write some text appearing in both files using the standard markup language.

Use the r chunk to display some code in both files.

head(cars)

Use the r chunk with solution = TRUE to display and evaluate the chunk only in the solution file.

# Only visible and evaluated in the solution file...
plot(cars)

You can also add some markdown formatted text with the asis engine together with solution = TRUE

```{block, solution = TRUE} This is the text explaining how to obtain the solution and written in Rmarkdown

Use the knit dropdown menu on the knit button to generate the desired output:

- Using `unilur::tutorial_pdf_solution` or `unilur::tutorial_html_solution` will show the solution boxes.
- Using `unilur::tutorial_pdf` or `unilur::tutorial_html` will hide them from the output.

```{block, box.title = "Tip", box.body = list(fill = "lightblue")}
You can also include custom boxes to highlight some content. Read the [article](http://koncina.github.io/unilur/articles/custom-boxes.html) to learn more about how to customize the appearance.


koncina/unilur documentation built on Sept. 24, 2021, 12:24 a.m.