Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get pandoc to generate PDF with sans-serif font family

I'm trying to use pandoc to generate a PDF from Markdown source. I'd like the output to use only sans-serif fonts. Input:

# Hello

This is a test.

Command line:

pandoc -o output.pdf input.md --variable=fontfamily:arev

I get a fine-looking PDF, but the text is serif. Output:

Screenshot of PDF generated from Markdown source with pandoc showing serif fonts

I tried many different command lines, but the font (family) never changes.

I'm using Ubuntu 14.04. I installed pandoc via apt-get.

like image 608
Adam Monsen Avatar asked Oct 23 '25 14:10

Adam Monsen


1 Answers

I had to install arev, bera and mathdesign fonts first, but your command worked fine for me:

screenshot

For Ubuntu and TeXLive these fonts are located in the package texlive-fonts-extra

The version from the Ubuntu repositories is quite old, so better first go here and install the latest from the Debian package.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!