Set code background colour in R markdown to PDF
When an Rnw file is converted to PDF with RStudio and knitr , the code blocks have a pleasant grey background colour (like they do here at SO). When I convert a md file to PDF , the background colour is white and I can't seem to change it. The knitr code decoration option background is only for LaTeX and has no effect in md . How can I set a background colour for code blocks in the PDF I get from my md file? I see in some related questions that editing the markdown.css file might be relevant, but I'm not sure if that applies here since there's no html file in between the md and PDF files. This