I have pandoc and would like to change the awful default font when I convert a .MD to a .PDF.

I understand I can pass -V on the command line and that pandoc uses --pdf-engine=pdflatex by default. I would like to change the font family to https://tug.org/FontCatalogue/clearsans/. I try:

pandoc -V fontfamily="ANYTHING" test.md -o test.pdf

and just get

Error producing PDF.
! LaTeX Error: File `ANYTHING.sty' not found.

I am reading about different engines, which don't seem to be installed. I can look at a config file that is total mumbo-jumbo.

Can I just list what fonts or font family's are available and choose one on the command line?

I installed texlive on Centos 8 and it installed a lot... but there seems still more packages. It seems a lot of work to change a font!

tex --version
TeX 3.14159265 (TeX Live 2018)
kpathsea version 6.3.0

also I see included in the install were:

Name         : texlive-latex-fonts
Summary      : A collection of fonts used in LaTeX distributions
URL          : http://tug.org/texlive/
License      : LPPL
Description  : This is a collection of fonts for use with standard latex
             : packages and classes. It includes 'invisible' fonts (for use
             : with the slides class), line and circle fonts (for use in the
             : picture environment) and 'latex symbol' fonts. For full support
             : of a latex installation, some Computer Modern font variants
             : cmbsy(6-9), cmcsc(8,9), cmex(7-9) and cmmib(5-9) from the
             : amsfonts distribution, are also necessary. The fonts are
             : available as Metafont source, and metric (tfm) files are also
             : provided. Most of the fonts are also available in Adobe Type 1
             : format, in the amsfonts distribution.

Name         : texlive-collection-basic
Summary      : Essential programs and files
URL          : http://tug.org/texlive/
License      : Artistic 2.0 and GPLv2 and GPLv2+ and LGPLv2+ and LPPL and MIT
             : and Public Domain and UCD and Utopia
Description  : These files are regarded as basic for any TeX system, covering
             : plain TeX macros, Computer Modern fonts, and configuration for
             : common drivers; no LaTeX.

Name         : texlive-collection-fontsrecommended
Summary      : Recommended fonts
URL          : http://tug.org/texlive/
License      : Artistic 2.0 and GPLv2 and GPLv2+ and LGPLv2+ and LPPL and MIT
             : and Public Domain and UCD and Utopia
Description  : Recommended fonts, including the base 35 PostScript fonts,
             : Latin Modern, TeX Gyre, and T1 and other encoding support for
             : Computer Modern, in outline form.
  • Welcome to TeX-SX! As a new member, it is recommended to visit the Welcome and the Tour pages to be informed about our format and also to know about Minimal Example. Otherwise, more specifically about your question: have you tried with a standard TeXLive font first ? (like lmodern) – R. N Jan 30 '20 at 12:02

On a recent TeX Live installation

pandoc -V fontfamily:ClearSans -V fontfamilyoptions:sfdefault test.md -o test.pdf

should work. To make sure that the right package is installed use the package manager tlmgr¹

tlmgr install clearsans

  1. Maybe you need to use sudo, depending on your installation
  • 1
    Afraid I get ! LaTeX Error: File ClearSans.sty not found. There is no tlmgr on my system or available. There are no .sty files on my computer! – Sumomo Jan 30 '20 at 12:34
  • Looks like the TL shipped with CentOS is defective. I suggest you remove ist and install a vanilla TL. This tutorial is for CentOS7 but it should work also with 8: systutorials.com/241660/… – DG' Jan 30 '20 at 12:52
  • I am very reluctant to use anything other than the official packages. Centos 8.1 is RHEL 8.1 which is the most stable and trusted distro, can't believe it has a bug so big that none of the fonts work in TL! What can I do to confirm that TL can see fonts, can I list installed without tlmgr? Cheers! – Sumomo Jan 30 '20 at 13:12
  • @Sumomo --- What happens if you enter kpsewhich ClearSans.sty in the terminal? – Ian Thompson Jan 30 '20 at 13:25
  • Well TeX on linux distributions is a critical topic, discussed extensively elsewhere. If you don't want to install TeX Live manually (still recommended) you should install all the extra packages, try: yum install texlive-scheme-full. Or you could figure out, which package provides the fonts you seek: sudo yum whatprovides '*/ClearSans.sty' – DG' Jan 30 '20 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.