Environment: OSX 10.13.4, spacemacs 0.200.7

Here's a pared-down org-beamer file

#+TITLE: A Presentation
#+SUBTITLE: A really good one, in fact
#+AUTHOR: WallyMetropolis
#+DATE: 05-02-2018
#+OPTIONS: H:2 toc:1 num:t
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation, usepdftitle=false, bigger]
# Have to set Metropolis specific package options here
#+LATEX_HEADER:\mode<beamer>{\usetheme[numbering=fraction, progressbar=frametitle, titleformat=smallcaps]{metropolis}}
#+BEAMER_HEADER:\setmainfont{Fira Sans}
* Testing
** How does it look?

I export this to a pdf with M-x org-beamer-export-to-pdf

I'd like to use the Fira font recommended by the Metropolis theme, but I'm unable to correctly install or set the font.

I have tried variations on setting the font, including



#+BEAMER_HEADER:\setsansfont{Fira Sans}

in the org file.

and the Org PDF LaTeX Output shows

! Undefined control sequence.
l.51 \setsansfont
   {Fira Sans}

To install the font itself, I tried:

brew tap caskroom/fonts
brew cask install font-fira-code

But I'm unconvinced that this made the font available for an org-beamer pdf export.

I have also tried things like

sudo tlmgr install fira-sans

which resulted in

Unknown directive ...containerchecksum 400c4de374d03934965b5488f37c1b052ade3eda3zzzzzzzz57c9846390b2b78315c6aed2b533a2271bbacabd77c44536b63973bd42e2686f4c6d25d1f4c5b4709e... , please fix it! at /usr/local/texlive/2014/tlpkg/TeXLive/TLPOBJ.pm line 210, <$retfh> line 6001.
  • \setsansfont is part of the fontspec packages which depends on XeLaTeX. Have you loaded fontspec before using \setsansfont? An MWE would be good. – Timm May 3 '18 at 10:06
  • I've added an example. No, I did not add fontspec. I am having some trouble finding documentation to guide me. Is there a way to apply the font without XeLaTeX? – Metropolis May 3 '18 at 17:26
  • This sounds like a LaTeX question rather than an Emacs question. Is that correct? (I.e., can you make this work in LaTeX but cannot figure out how to get org to do it, or can you not make it work with LaTeX itself?) – Dan May 3 '18 at 18:47
  • Good question. I'll see if I can get something working in LaTeX itself. – Metropolis May 3 '18 at 20:13
  • 1
    As I said, fontspec requires XeLaTeX. See here: ctan.org/pkg/fontspec. Using arbitrary system fonts with PDFLaTeX is not possible without a non-trivial preprocessing step, so XeLaTeX (or LuaLaTeX) is the way to go. – Timm May 4 '18 at 8:13

Your Answer

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

Browse other questions tagged or ask your own question.