4

The Metropolis Beamer theme uses Fira Sans by default, but I'm unsure whether its documentation is using the same font. When I try to load Fira Sans into my own documents, they do not look like that.

For reference, I'm attaching the desired and actual fonts below. I'm using \usepackage[sfdefault,lining]{FiraSans} in my document.

Metropolis

Metro

Mine

Mine

Daniel
  • 233
  • 1
    Using the methods described in https://tex.stackexchange.com/q/45919/82917 you can find out that it is FiraSans Light. Add the option light to \usepackage. – campa Oct 27 '21 at 07:31
  • @campa Thank you. This does definitely help. I didn't know there could even exist tools for extracting fonts from pdfs, thanks, I'll check into that. I imagined it was Fira Sans but I couldn't find the appropriate options to pass to the package. I just noticed it's in the readme of the package though (https://www.ctan.org/tex-archive/fonts/fira). Thanks – Daniel Oct 27 '21 at 07:36
  • @campa Just a quick question though. The document does look closer to what I'm looking for after adding the light option. However, I noticed that mine looks a bit more "packed", while in the reference above the characters have a bit more space between them. How is this achieved? – Daniel Oct 27 '21 at 07:39
  • You mean spacing between words? Well, that of course depends on the paragraph, spaces can be stretched. If I type 'A good presentation' in FiraSansLight 10pt I get obviously a slightly different interword spacing, but the words themselves are superimposable. – campa Oct 27 '21 at 07:44
  • @campa I meant characters, but this could be just my perception as I feel my output was a bit more "condensed", or "packed". This is probably not the case though. Thanks for the answer, it did address my question. Feel free to post as answer so that I can close this (else I will choose to close based on the suggestion of the linked question) – Daniel Oct 27 '21 at 07:47

1 Answers1

2

The source code is available with your TeX installation. The fonts in the theme are defined as:

  \iffontsavailable{Fira Sans Light,%
                    Fira Sans Light Italic,%
                    Fira Sans,%
                    Fira Sans Italic}%
  {%
    \setsansfont[ItalicFont={Fira Sans Light Italic},%
                 BoldFont={Fira Sans},%
                 BoldItalicFont={Fira Sans Italic}]%
                {Fira Sans Light}%
  }{%
    \iffontsavailable{Fira Sans Light OT,%
                      Fira Sans Light Italic OT,%
                      Fira Sans OT,%
                      Fira Sans Italic OT}%
    {%
      \setsansfont[ItalicFont={Fira Sans Light Italic OT},%
                   BoldFont={Fira Sans OT},%
                   BoldItalicFont={Fira Sans Italic OT}]%
                  {Fira Sans Light OT}%
    }{%
      \PackageWarning{beamerthememetropolis}{%
        Could not find Fira Sans fonts%
      }
    }
  }

And in the documents source it is nearly the same as:

  \iffontsavailable{Fira Sans Light,%
                Fira Sans Light Italic,%
                Fira Sans,%
                Fira Sans Italic}{%
    \setmainfont[BoldFont={Fira Sans}]{Fira Sans Light}%
  }{%
    \iffontsavailable{Fira Sans Light OT,%
                  Fira Sans Light Italic OT,%
                  Fira Sans OT,%
                  Fira Sans Italic OT}{%
      \setmainfont[BoldFont={Fira Sans OT}]{Fira Sans Light OT}%
    }{%
      \typeout{%
        Could not find Fira Sans fonts. Creating documentation%
        with standard fonts.%
      }
    }
  }
  \iffontsavailable{Fira Mono, Fira Mono Bold}{%
    \setmonofont{Fira Mono}%
  }{%
    \iffontsavailable{Fira Mono OT, Fira Mono Bold OT}{%
      \setmonofont{Fira Mono OT}%
    }{%
      \typeout{%
        Could not find Fira Sans fonts. Creating documentation%
        with standard monospaced fonts.%
      }
    }
  }
}{
  \typeout{%
    You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts.%
  }
}
user187802
  • 16,850
  • That's the source code for the Metropolis theme itself, not the source code of the documentation pdf, which is what I'm interested in. It turns out it's the same font however, I was missing the light option. I'm still struggling with getting the same space between characters though. – Daniel Oct 27 '21 at 07:41
  • sure, but it uses the same definitions for the font settings. Have a look into the documents source! – user187802 Oct 27 '21 at 07:43
  • I see you updated the answer. How did you find the source code for the documentation? – Daniel Oct 27 '21 at 10:00
  • 1
    As I already wrote, it is part of your TeX distribution: kpsewhich metropolistheme.dtx shows /usr/local/texlive/2021/texmf-dist/source/latex/beamertheme-metropolis/metropolistheme.dtx on. my system. – user187802 Oct 27 '21 at 11:51
  • 1
    I didn't know the source code of documentations were in the TeX distribution. That's a great fact to know, thanks! – Daniel Oct 27 '21 at 15:56