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

前端 未结 2 1237
失恋的感觉
失恋的感觉 2021-02-07 12:04

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:

相关标签:
2条回答
  • 2021-02-07 12:45

    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.

    0 讨论(0)
  • 2021-02-07 12:48

    When you use xelatex or lualatex to render the PDF you must use:

    ---
    mainfont: Arial
    ---
    

    Official documentation: Variables for LaTeX

    0 讨论(0)
提交回复
热议问题