Markdown to PDF conversion in Pandoc: making pages landscape

conversionmarkdownpandocpdf

I am converting a document from Pandoc markdown to .pdf.
I run the conversion like this, and everything works fine:

pandoc test.MD -f markdown -o test.pdf

However, I would like pandoc to output my PDF pages in landscape, rather than portrait, format. Is there a way to do this?

In the documentation, I could not find the right command (checking under Variables for LaTex). Adding the command \setuppapersize[letter,landscape], which is mentioned there, seems to work only if you use the Context engine which I have no experience with / not installed. I also wanted to note that I am using the \newpage command to break the file up into pages, just in case that makes a difference.

I'd be grateful for any pointers!

Best Answer

Not sure how exactly it works if you convert from a markdown file, but for converting html to pdf using latex, I could make the pdf be landscape by adding this flag to the command:

-V geometry:landscape

So the complete command in your case could then be:

pandoc test.MD -V geometry:landscape -f markdown -o test.pdf

Note, as I said I used latex to convert, so I only can confirm that this one here will work:

pandoc test.html -V geometry:landscape -t latex -o test.pdf

Hope this is useful.

Related Question