Search code examples
rbookdown

How to add a new language for highlight in bookdown


I'm writing a document in rmarkdown with the thesisdown template.

Related to the issue thesisdown-41: how can I add a new language for highlighting which is currently not supported?

The project mentioned in the link is derived from bookdown


Solution

  • Under the hood bookdown uses pandoc for tranforming markdown to HTML/PDF/.... From pandoc's manual at http://pandoc.org/MANUAL.html#syntax-highlighting we get:

    • The library used for highlighting is skylighting.
    • The list of available languages can be retrieved with pandoc --list-highlight-languages