Python syntax highlighting not working

I am trying to create notebooks in which I present the same algorithm written in R and Python. I can easily integrate R and Python code into an Rmd file, and then generate HTML output using the "Embed HTML" button in RStudio. However, Python code is always displayed without syntax highlighting (not like in the example in https://github.com/yihui/knitr-examples/blob/master/023-engine-python.md ). I have Andre Simon, who highlighted software installed and running on my computer (MacBook Pro Retina, MacOS X 10.9).

Currently, I have the following libraries installed in R: markdown 0.6.4, knitr 1.5.15, highr 0.3.1.

Any idea what could be the problem? Thank you for your help!.

+7
r syntax-highlighting rstudio knitr r-markdown
source share
1 answer

This refers to RStudio Markdown rendering, which did not include syntax highlighting for code blocks that are not R or C ++. RStudio uses highlight.js , and you can use your own version of highlight.js to highlight Python code. Or use other Markdown converters such as Pandoc .

+6
source share

All Articles