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

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

--- font: MySansSerifFontName ... 

I am using TexLive for Linux (Ubuntu) with pandoc , of course.

+6
source share
2 answers

This should do the trick:

 --- fontfamily: arev --- 

From Pandoc README :

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

+5
source

When using xelatex or lualatex for PDF rendering, you should use:

 --- mainfont: Arial --- 

White papers: Variables for LaTeX

+2
source

Source: https://habr.com/ru/post/977011/


All Articles