# Beamer metropolis theme, recommend a math font that matches with Fira

## Original Question

The Beamer theme "metropolis" uses by default the Fira family of typefaces.

I'm not particularly satisfied by the combination of Fira and the usual math fonts, which math fonts would you recommend?

My preamble is

\documentclass[aspectratio=169]{beamer}
\usetheme[titleformat=smallcaps,block=fill]{metropolis}
%\metroset{outer/frametitleformat=smallcaps}
\setbeamertemplate{blocks}[rounded]


The results are like this

I have used the Euler font and the following MWE

17:37 boffi@debian:~ $cat a.tex \documentclass[aspectratio=169]{beamer} \usepackage{eulervm} \usetheme{metropolis} \begin{document} ABCDEFGHIJKLMNOPQRSTUVwxyZ0123456789\\ abcdefghijklmnopqrstuvwxyz0123456789\\$z = d - \kappa x = (1 - \kappa\xi) d = \zeta d$\end{document}  It is worth to note that pdflatex has no direct means to load system OTF fonts and that metropolis automagically uses a font different from Fira in this case.. I have $ pdflatex a; mv a.pdf a_pdf.pdf; lualatex a; mv a.pdf a_lua.pdf
... lots of stuff
$ to have the following results 17:36 boffi@debian:~$ pdffonts a_pdf.pdf
name                            type              encoding         emb sub uni object ID
------------------------------- ----------------- ---------------- --- --- --- ---------
TJUSKZ+CMSS10                   Type 1            Builtin          yes yes no      18  0
ZNYXXU+CMSSI10                  Type 1            Builtin          yes yes no      19  0
WUOKZV+EUFM10                   Type 1            Builtin          yes yes no      20  0
SNTYPH+EURM10                   Type 1            Builtin          yes yes no      21  0
OOQWQL+CMSS8                    Type 1            Builtin          yes yes no      22  0
17:37 boffi@debian:~ $pdffonts a_lua.pdf name type encoding emb sub uni object ID ------------------------------- ----------------- ---------------- --- --- --- --------- UQMZJP+FiraSans-Light CID Type 0C Identity-H yes yes yes 18 0 FCXRGI+FiraSans-LightItalic CID Type 0C Identity-H yes yes yes 19 0 WUOKZV+EUFM10 Type 1 Builtin yes yes no 20 0 SNTYPH+EURM10 Type 1 Builtin yes yes no 21 0  and these are the relevant screenshots ### pdflatex ### lualatex (I have also used xelatex but the results are the same as in lualatex, so I've omitted its results) I have these issue with math fonts and Fira 1. the x-height is significantly smaller for both CMMI and Euler 2. Euler strokes and, to a lesser degree CMMI strokes are significantly heavier than Fira Light Italic 3. Euler is however better (imho) because CMMI is SO CURLY when compared to Fira. • The developers of metropolis are well aware that there is a problem with math fonts (see this Github issue) but, for now, have decided to not decide which of the possible solutions adopt — maybe because no one works well for everyone? – gboffi Nov 29 '17 at 17:17 ## 2 Answers ### Update I have just discovered the existence of FiraMath font, here an example of the font from https://github.com/firamath/firamath The Github repository above gives instructions for installing the font ­– but it's already in Texlive – and instructions to use it in XeLaTeX or LuaLaTeX that I report for completeness \documentclass{article} \usepackage{amsmath} \usepackage[mathrm=sym]{unicode-math} \setmathfont{Fira Math} \begin{document} $\int_0^{\mathrm{\pi}} \sin x \, \mathrm{d}x = 2$ \end{document}  I've found that arevmath is the way to go, but to have a good match with the metropolis theme one has to modify slightly the weights of Fira. metropolis uses Fira Lightand Fira Book for regular and bold text, that are both light when compared to arev mathematical characters. To have a better match I've changed in the preamble the sans font and the relevant variations as follows \documentclass[aspectratio=169]{beamer} \usetheme{metropolis} \usepackage{arevmath} \setsansfont[ BoldFont={Fira Sans SemiBold}, ItalicFont={Fira Sans BookItalic}, BoldItalicFont={Fira Sans SemiBold Italic} ]{Fira Sans Book} \begin{document} % ...  and using the following body % ... \emph{ABCDEFG abcdefg 0123456789}\\ \textbf{ABCDEFG abcdefg 0123456789}\\ \emph{\textbf{ABCDEFG abcdefg 0123456789}} $z = f(g)-B-\kappa x+\beta n = (1-\kappa\xi).$ $z = \boldsymbol{f}(g)-B-\kappa x+\beta n = (1-\boldsymbol{\kappa}\xi).$ \end{document}  I can have the following results In my opinion there is a good match between math and text but I'm very open to criticisms. Perhaps eulervm, though it is obviously a question of preference. In this case, I find the weight, the taper, and ornamentation (i.e., curliness) to be a better fit. \documentclass[aspectratio=169]{beamer} \usepackage{eulervm} \usetheme[titleformat=smallcaps,block=fill]{metropolis} %\metroset{outer/frametitleformat=smallcaps} \setbeamertemplate{navigation symbols}{} \setbeamertemplate{blocks}[rounded] \begin{document} \begin{frame}$z = d - \kappa x = (1 - \kappa\xi) d = \zeta d\$
\end{frame}
\end{document}


For comparison, with standard math font:

POSTSCRIPT

My example was compiled in pdflatex. Interestingly, the OP points out (and I can confirm) that running either of my two examples in xelatex or lualatex inexplicably increases the size of the text font. Very strange.

• I agree with your "curliness" comment and convene that Euler is a better match. I have a doubt though, if you look at my post (now edited, I've included a larger screenshot) you will notice that the greek letters are distictly smaller than roman ones, while in yours screenshot of standard math the letters have the same height. I have compiled with LuaLatex, is this the cause of this strange difference? – gboffi Nov 29 '17 at 15:53
• @gboffi For those kind of discrepancies, you really need to post a full MWE, not just a code snippet. What you show should not be happening all by itself. – Steven B. Segletes Nov 29 '17 at 15:56
• @gboffi You are right. You might edit your question (or add an addendum) pointing out that compiling in lualatex or xelatex causes the math font size to be reduced. – Steven B. Segletes Nov 29 '17 at 16:07
• No, the problem is not Lua/Xe Latex, the problem is PdfLatex that is not using Fira... if you look at my roman letters, they have no width variation in ovals and stem (no variation is a characteristic of Fira Light). If you have used PdfLatex metropolis automagically switches to another, I don't remember which, font — Euler's x-height is less than Fira's, also the thickness of stems in Euler is distinctly heavier if you compare with real Fira. I'm going to post a screenshot with Fira and Euler... – gboffi Nov 29 '17 at 16:27
• Re your postscript, it's not math that's inexplicably smaller, it's the roman font that's larger... – gboffi Nov 29 '17 at 16:58