Is there a way to parse text as is in rmarkdown, like the <pre>
tag for HTML but for docx (Microsoft Word) export with knitr
? When I use the tag <pre>
it hides it in words... I could use a R code chunk and commenting it out but maybe there is a better way...
I would like to copy the output from R and paste it in my text markdown so it is always there...
For example
[1] “Results” 1 2 3 4 5 6 7
gives the following in Word after knitr export:
[1] “Noeuds” 2 3 4 5 6 7
I would like to keep the same formatting as the example..
This is what I use at the moment with an R code chunk:
```{r}
#[1] “Results”
# 1 2 3 4 5 6 7
```
Either indent the text block by four spaces, or put it in a fenced code block, e.g.,
```
[1] “Results”
1 2 3 4 5 6 7
```
See Pandoc's documentation on verbatim (code) blocks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With