7

I would like to do a beamer presentation using metropolis theme but am experiencing pb with Fira font.

I am with MacOs 10.13, and TexStudio.

I have checked these previous questions:

but none of the solutions proposed solved my pb.

I have downloaded the demo (as zip) from Overleaf web site. As in this demo package, the metropolis sty files are sitting next to my .tex

I downloaded Fira font as explained here: https://gist.github.com/muammar/a5ffb635eb7f532346a8e777b847f8a7 and Fira font is under my user/Library/Fonts.

I compile with xeLatex.

Here is a test doc:

\documentclass[10pt]{beamer}

\usetheme[progressbar=frametitle]{metropolis}
\usepackage{appendixnumberbeamer}
\usepackage{pgfplots}
\usepackage{xspace}

\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
\setsansfont[BoldFont={Fira Sans}]{Fira Sans Light}
\setmonofont{Fira Mono}
\usepackage[sfdefault]{Fira Sans}

\title{Problem with Fira Sans}
\subtitle{test}
\date{}


\begin{document}

\maketitle

\begin{frame}{Test font}
 \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{frame}

\begin{frame}[fragile]{Font not working}

  The \themename theme is a Beamer theme with minimal visual noise
  inspired by the \href{https://github.com/hsrmbeamertheme/hsrmbeamertheme}    {\textsc{hsrm} Beamer
  Theme} by Benjamin Weiss.

  Enable the theme by loading

  \begin{verbatim}    \documentclass{beamer}
    \usetheme{metropolis}\end{verbatim}

  Note, that you have to have Mozilla's \emph{Fira Sans} font and XeTeX
  installed to enjoy this wonderful typography.
\end{frame}

\end{document}

When using explicitely the font (Test font), it works, but the full document does not take Fira.

One last point: the log file shows that texlive is being used:

LaTeX Info: Redefining \ttfamily on input line 13.

(/usr/local/texlive/2017/texmf-dist/tex/latex/fira/FiraSans.sty
 Package: FiraSans 2016/11/20 (Bob Tennent and autoinst) Style file for Fira     San...
...
Requested font "[FiraSans-Regular.otf]/OT" at 10.0pt
 -> /usr/local/texlive/2017/texmf-dist/fonts/opentype/public/fira/FiraSans-    Regu
 lar.otf
 \g__fontspec_family_FiraSans_int=\count297
Requested font "[FiraSans-Bold.otf]/OT" at 10.0pt
 -> /usr/local/texlive/2017/texmf-dist/fonts/opentype/public/fira/FiraSans-     Bold
 .otf
 Requested font "[FiraSans-RegularItalic.otf]/OT" at 10.0pt
  -> /usr/local/texlive/2017/texmf-dist/fonts/opentype/public/fira/FiraSans-     Regu
 larItalic.otf
 Requested font "[FiraSans-BoldItalic.otf]/OT" at 10.0pt
  -> /usr/local/texlive/2017/texmf-dist/fonts/opentype/public/fira/FiraSans-Bold
 Italic.otf
 .................................................
 . fontspec info: "defining-font"
 . 
 . Font family 'FiraSans(0)' created for font 'FiraSans' with options
 . [Ligatures = TeX,Scale = 1,Extension = .otf,Ligatures=TeX,Numbers =
 . {Proportional,OldStyle},UprightFont = *-Regular,ItalicFont =
 . *-RegularItalic,BoldFont = *-Bold,BoldItalicFont = *-BoldItalic].
 .  
 s fonts.

(sorry for the no so well formatted copy-and-paste).

Many thanks in advance for your help.

  • 2
    +1 For code example and documented research :) – Dr. Manuel Kuehner Jun 9 '18 at 9:54
  • Are \usepackage{appendixnumberbeamer} \usepackage{booktabs} \usepackage[scale=2]{ccicons} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} needed dor the problem at hand? – Dr. Manuel Kuehner Jun 9 '18 at 9:55
  • @Dr.ManuelKuehner no indeed these packages have nothing to do with the current pb. I just recompiled without them to get the test cleaner, pb persist. The issue message is still Font shape TU/FiraMono(1)/m/sc undefined(Font) using TU/FiraMono(1)/m/n instead. I have the feeling the pb is related to finding the font, but could not find how to do so far. – ecrin Jun 9 '18 at 10:07
  • I can't help you with your actual problem but normally it is good to remove all unrelated code part. – Dr. Manuel Kuehner Jun 9 '18 at 10:30
  • @Dr.ManuelKuehner: anyway, thanks for your attention! I edited the link to the overleaf demo, and remove unnecessary packages in the example code. Now waiting and hoping that someone could have the solution. – ecrin Jun 9 '18 at 12:03
2

If the metropolis theme is compiled with xelatex, it uses fira fonts per default. So there is no need to manually interfere with the font selection and risk problems. In fact the example compiles just fine if the three lines related to fonts are removed.

% !TeX TS-program = xelatex

\documentclass[10pt]{beamer}

\usetheme[progressbar=frametitle]{metropolis}
\usepackage{appendixnumberbeamer}
\usepackage{pgfplots}
\usepackage{xspace}

\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
%\setsansfont[BoldFont={Fira Sans}]{Fira Sans Light}
%\setmonofont{Fira Mono}
%\usepackage[sfdefault]{Fira Sans}

\title{Problem with Fira Sans}
\subtitle{test}
\date{}


\begin{document}

\maketitle

\begin{frame}{Test font}
 \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{frame}

\begin{frame}[fragile]{Font not working}

  The \themename theme is a Beamer theme with minimal visual noise
  inspired by the \href{https://github.com/hsrmbeamertheme/hsrmbeamertheme}    {\textsc{hsrm} Beamer
  Theme} by Benjamin Weiss.

  Enable the theme by loading

  \begin{verbatim}    \documentclass{beamer}
    \usetheme{metropolis}\end{verbatim}

  Note, that you have to have Mozilla's \emph{Fira Sans} font and XeTeX
  installed to enjoy this wonderful typography.
\end{frame}

\end{document}
2

In case it can help others facing same problem:

What works was to copy the Fira Font files I had downloaded as indicated here in user/Library/Fonts to the place where tex was actually looking for them (indicated in the log), i.e. /texlive/2017/texmf-dist/fonts/opentype/public/fira.

As indicated by @samcarter, no need to have \setsansfont[BoldFont={Fira Sans}]{Fira Sans Light} \setmonofont{Fira Mono} \usepackage[sfdefault]{Fira Sans}, xeLatex does the job by itself.

Last word: it pays off to look at the log file to understand what happens, even if long!

  • +1 especially for your last sentence! – user36296 Jun 9 '18 at 13:35

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.