How to syntax highlight inline R code in R Markdown?

前端 未结 2 1056
面向向阳花
面向向阳花 2020-12-13 16:05

This question is similar to consistent code html inline and in chunks with knitr. Instead of .Rhtml documents, I want to highlight inline R code in R Markdown documents, e.g

2条回答
  •  清歌不尽
    2020-12-13 16:47

    Now-a-days:

    Here is some `plot(cars, main = 'A scatterplot.')`{.R} inline R code
    

    Well, I don't know specifically about R and the way you're using it, but for most languages (pandoc uses the skylighting pkg to do this), you can do inline code blocks with the above syntax.

提交回复
热议问题