I started using knitr with reStructuredText today and I found that the syntax highlighting with pygments (used by
rst2html.py) was not as nice as the output of pandoc. So I ended up doing some monkeypatching.
Try adding the following to
# SLexer is the lexer used for R from pygments.lexers.math import SLexer from pygments.token import Keyword, Name # monkey patching SLexer ... # add some builtin functions (TODO: add more) SLexer.tokens['keywords'].append( (r'(?
Note: I assume you already added pygments’ rst-directive.py to