#Rmdx::install_crender()
library(crender)
knitr::opts_chunk$set(echo = cr_val(), include = cr_val(), comment = "")

This document generates three different documents:

Each of these documents has its own structure but they share some elements, such as the fact that the processing occurs only once and is shared among all you documents, which means that if you make a change in any calculation or formula, you will see reflected in all related documents immediately.

You can also read the [quick start guide] (https://drdsdaniel.github.io/crender/articles/crender.html) of crender for more details. In crender the normal text appears in all formats.

`r cr_content("

Text

To insert text conditionally you must use the cr_content() function.

This text will only appear in the formats marked true, yes or TRUE in the yaml (in this case only in the html format). If the format is not specified in the yaml parameters, the default value is true.

You can also insert simple R evaluations along with the text. To do this you must enclose the code in braces. For example {sum(1:4)}, it will look like 10.

Code chunk

By default, the code chunks will only affect the formats marked as true, yes or TRUE in the yaml, as long as the corresponding settings have been established in the chunk options echo = cr_val(): indicates that the code will appear in the formats marked as rue, yes or TRUE in the yaml; include = cr_val(): indicates that the results of the code block will be inserted in the formats marked as true, yes or TRUE in the yaml; and so on for all other Boolean type chunk options. ")`

cars

`r cr_content("

Double conditional

The double conditional, cr2, negates the default value for a format.

In this case, this text and the graphic below will be available in the pdf (latex) format which is set as false in the yaml and when negated by the double conditional, resulting in true; in the html that this is set to true in the yaml and the double conditional is not affecting it; but not in the ioslides since on the contrary it is set as false in the yaml and the double conditional is not affecting it.

You can double condition as many formats as you want.

", cr2 = c("latex"))`

plot(cars)

`r cr_content("

Exclusive content


Furthermore, if you want to display content in specific formats, then you can use the only argument of the crender functions, so this text, the code and the resulting table below will only be available in the ioslides presentation. ", only = "ioslides")`

head(cars)

Bibliography {-}

r cr_content("---", only = "ioslides")



drdsdaniel/Rmdx documentation built on Nov. 8, 2021, 2:39 a.m.