0

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?

Alexander Engelhardt
  • 1,632
  • 3
  • 16
  • 31
  • Did you try this http://stackoverflow.com/questions/10128702/how-to-preserve-formatting-from-rstudio-when-copy-pasting-to-word – 67342343 Mar 28 '17 at 10:04

1 Answers1

1

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
---
rsmith54
  • 818
  • 9
  • 15