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
```
asis=TRUE
in the chunk options? yihui.name/knitr/options/#text-results (your question isn't entirely clear) – Ben Bolker