By doubling the backticks in Markdown, it is easy to render some text in code style including the backticks, such as: `r 2+2`. But how to do that with RMark
`r 2+2`
Here is a satisfactory finding. First define the function
rinline <- function(code){ html <- '``` `r CODE` ```' sub("CODE", code, html) }
``` `r CODE` ```
in an invisible chunk. Then you can show `r 2+2` by typing:
Some R code inline : `r rinline("2+2")` - nice