Reputation: 1712
For a thesis, I would like to attach the code (not the output) of my .Rmd document, ideally with the pretty syntax highlighting that RStudio does.
Is there a way to export highlighted RMarkdown code to a file, ideally PDF?
Upvotes: 1
Views: 955
Reputation: 805
I would check this out.
http://rmarkdown.rstudio.com/pdf_document_format.html#appearance_and_style
I think it should be as simple as
---
title: "Habits"
output:
pdf_document:
highlight: tango
---
Upvotes: 1