python highlighting in Rmarkdown in RStudio

风格不统一 提交于 2019-12-03 07:49:00
output: 
  html_document:
    highlight: pygments

in the head did the trick.

The engine option tells knitr which language to use to actually run the code chunk.

What they are referring to in the release notes is syntax highlighting in the source code editor. Open an existing Python source file in the editor and you will see it is correctly highlighted.

Language-dependent syntax highlighting is usually selected based on the underlying language of the file you are editing (often simply based on the filename extension). In your example, you are editing a .RMd file, so the editor uses the syntax rules for r-markdown.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!