How can I change PDF output font from within the YAML header when using Pandoc on Markdown?

Kalin picture Kalin · Oct 21, 2014 · Viewed 8.2k times · Source

Is there a (built-in) way to set a different font (or fonts) to use in the Pandoc YAML header? Ideally, I would do something like this in the YAML header of my Markdown file:

---
font: MySansSerifFontName  
...

I'm using TexLive on Linux (Ubuntu), with pandoc, of course.

Answer

mb21 picture mb21 · Oct 21, 2014

This should do the trick:

---
fontfamily: arev
---

From Pandoc's README:

fontfamily: font package to use for LaTeX documents (with pdflatex): TeXLive has bookman (Bookman), utopia or fourier (Utopia), fouriernc (New Century Schoolbook), times or txfonts (Times), mathpazo or pxfonts or mathpple (Palatino), libertine (Linux Libertine), arev (Arev Sans), and the default lmodern, among others.