I use pandoc to simply compile pdf files from markdown files:

pandoc markdown.md -o output.pdf

however this renders the PDF with lots of white space. Is there a way to change the layout of the output or do I have to go the way through a tex file?


pandoc markdown.md -o output.tex

# edit margins of the output.tex;
# then:

pandoc markdown.tex -o output.pdf

As documented in the pandoc manual, you can either specify the margin in the YAML header of your markdown file:

geometry: margin=30mm

Or you can pass the value as a variable on the command line:

pandoc markdown.md -V geometry:margin=1in -o output.tex

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.