问题
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.
回答1:
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),utopiaorfourier(Utopia),fouriernc(New Century Schoolbook),timesortxfonts(Times),mathpazoorpxfontsormathpple(Palatino),libertine(Linux Libertine),arev(Arev Sans), and the defaultlmodern, among others.
回答2:
When you use xelatex or lualatex to render the PDF you must use:
---
mainfont: Arial
---
Official documentation: Variables for LaTeX
来源:https://stackoverflow.com/questions/26479047/how-can-i-change-pdf-output-font-from-within-the-yaml-header-when-using-pandoc-o