Set double spacing and line numbers when converting from Markdown to PDF with pandoc

Leosar picture Leosar · Feb 14, 2013 · Viewed 14.1k times · Source

I am using markdown & pandoc for scientific writing, I know I can change margins of the final pdf using

Set margin size when converting from Markdown to PDF with pandoc

but very often the journals require double lines and line numbers in submitted manuscripts, the question is how to change these, I don't know much about LaTex so I am lost in that jungle.

Thanks!

Answer

naught101 picture naught101 · Apr 15, 2015

In more recent version of Pandoc, you can use a YAML header and include a bunch of metadata in that, instead of using options on the command line. So, for instance, you can put this at the top of your .md file:

---
title: The Document Title
author:
    - Your Name
    - Co Author
date: \today{}
geometry: margin=2cm
header-includes:
    - \usepackage{setspace}
    - \doublespacing
    - \usepackage{lineno}
    - \linenumbers
---

Document Text

and pandoc will read those options and apply them automatically.