Pandoc Syntax Highlighting Examples


July 6, 2018

The R Markdown book lists many syntax highlighting color schemes:

highlight specifies the syntax highlighting style. Supported styles include default, tango, pygments, kate, monochrome, espresso, zenburn, haddock, and textmate. Pass null to prevent syntax highlighting.

Which is the same as running pandoc --list-highlight-styles (see Syntax Highlighting in the pandoc manual).1

But I couldn’t find a gallery for choosing among these syntax styles, so here’s a quick comparison.

highlight: default

highlight: espresso

highlight: haddock

highlight: kate

highlight: monochrome

highlight: pygments

highlight: tango

highlight: zenburn


Update: rmarkdown::pdf_document() doesn’t currently accept breezedark as a highlight style, but you can use the pandoc_args parameter to request this style (added in pandoc 1.19.2):

    pandoc_args: "--highlight=breezedark"


  1. Note that at the time of this writing 2023-02-05, pandoc has a new highlighting style breezedark that rmarkdown::pdf_document rejects. Also, textmate seems to have been deprecated because it is an HTML higlight style, so it is also rejected by pdf_document.↩︎