How to make newlines in inline chunks ? Rendering a word document
---
title: "R Notebook"
output: word_document
---
Cat `r cat("not \n working")`
writeLines `r writeLines("not \n working")`
print `r print("not \n working")`
capture.output cat `r capture.output(cat("not \n working"))`
```{r results='asis'}
cat("not \n working")
```
CodePudding user response:
We can use:
```{r results='asis'}
cat(paste("it is", "\\\n", "working"))
```
CodePudding user response:
You can use combine_words
from {knitr}
to do this in inline code.
`r knitr::combine_words(c("it is", "working"), sep = "\\\n", and = "")`