Keeping R Markdown syntax highlighting when printing
After doing your 'Knit' to your original example.Rmd you will have an example.md in your working path, then use pandoc...
# for pdf (you need to have latex installed)
system( "pandoc example.md -o example.pdf")
# for syntax-highlight persistant html
system("pandoc example.md -o example.html -s -S")