1

I'm trying to make a presentation with the Metropolis beamer theme which uses the Fira font when compiled with XeLatex.

I have the theme and fira installed from Miktex (https://miktex.org/packages/fira), but somehow the compiler can't find some of the fonts.

Font shape TU/FiraSansLight(0)/bx/sc' undefined(Font) usingTU/FiraSansLight(0)/bx/n' instead

Same with Monospace Italic

Font shape TU/FiraMono(0)/m/it' undefined(Font) usingTU/FiraMono(0)/m/n' instead

It just ends up looking like this: output

Does anyone know how to fix this?

  • An alternate method to avoid issues is to have a copy of the font files located in the same folder as the document. – Leucippus Jun 11 '17 at 19:26
  • Welcome to TeX.SX! Bold small-caps are a general problem. Have you tried downloading the fonts separately? – TeXnician Jun 11 '17 at 19:33
  • I'm starting to think that some of those don't work in general. Just found a compiled version of the demo on Overleaf and Mono Italics don't seem to work there either. overleaf.com/latex/templates/metropolis-beamer-theme/… Not really sure why Smallcaps work for them though. – JCF Jun 11 '17 at 19:48
  • 1
    Don't let us guess how you call the fonts. Make a small, complete example that demonstrates the issue and show also your log-file. – Ulrike Fischer Jun 11 '17 at 21:59
  • I have Fira installed on my system and, as far as I can tell, there is no oblique or italic mono shape. What you show look like the warnings LaTeX standardly issues in these cases and does not necessarily indicate any problem. The sans font does (bizarrely) appear to have bold small-caps for some reason. – cfr Jun 11 '17 at 23:58
2

For this to work easily, you need to install the fonts for your system. Whether the actual fonts are installed by the TeX distribution is not, just in itself, very relevant. (Installing them this way may get you useful helper files, but will not make them easily accessible.)

However, on Windows, this is done automatically when the fonts are installed by MikTeX or TeX Live. It may also be automatic if you use your GNU/Linux distro's packaged TeX Live, rather than upstream's. For an upstream install, TeX Live provides a file which can be used to enable this for GNU/Linux.

This means that you do not need to use file names to access the fonts, but can just use the font names. Moreover, most features and font-switches will work out-of-the-box, at least insofar as they are supported by standard NFSS.

For example:

\documentclass{article}
\usepackage{fontspec}
\setsansfont{Fira Sans}
\setmonofont{Fira Mono}
\begin{document}
\sffamily
Fira Sans
\itshape Fira Sans Italic
\bfseries Fira Sans Italic Bold
\upshape Fira Sans Bold
\scshape Fira Sans Bold Small-Caps
\itshape Fira Sans Bold Italic Small-Caps
\mdseries Fira Sans Italic Small-Caps
\upshape Fira Sans Small-Caps

\ttfamily
Fira Mono
\bfseries Fira Mono Bold
\end{document}

Fira sampler

I do not seem to have any italic, oblique or other shapes for Fira Mono. However, many more weights are available for Fira Sans, which also has a Condensed version, and one further weight for Fira Mono. See the fontspec manual for details if you want to access these or additional features.

  • For windows users there is no need to install the fonts system wide. Your example works fine for me in a current miktex and also in texlive. I get the same output as you. Actually when using xelatex it could do even harm if the fonts can be found in two locations. – Ulrike Fischer Jun 12 '17 at 8:10
  • @UlrikeFischer Interesting. Two locations works fine on GNU/Linux. (Obviously fc has to pick, so I can see it might create an issue if it picked the one you didn't want, but you could always tell it not to.) – cfr Jun 12 '17 at 12:44
  • @UlrikeFischer Is that because MikTeX/TeX Live adds the directories to the system-wide font configuration? This would be similar to the 09 file provided for GNU/Linux. (Not sure if this still helps on Mac OS X or not.) – cfr Jun 12 '17 at 12:46
  • @UlrikeFischer Is my edited version accurate for Windows? Or should I say that the font access works completely differently there? – cfr Jun 12 '17 at 12:54
  • windows doesn't have a system wide fontconfig. So the texsystems provide the fontconfig tools, and the configuration files are in the texmf tree. They normally include the texmf trees by default. Beside this: Imho it is not a good idea to speculate like this and offer a cure before the diagnose. Better wait for a MWE, then one can test if the behaviour is normal or indicates a problem and in the latter case try to find the source of the problem. – Ulrike Fischer Jun 12 '17 at 13:58

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.