3

I am looking for a nice sans serif math font to go with Fira Sans for beamer slides. I read the different suggestions in this post and found newtxsf to be the most fitting package. Indeed, it does look beautiful on lowercase greek letters, but for some reason, uppercase greek letters and numbers are still typeset in a serif font.

What am I doing wrong? Why doesn't the sans serif math package newtxsf change the shape of the uppercase greek letters and numbers?

\documentclass{beamer}

\usepackage{fontspec}
\usepackage{amsmath}
\setsansfont{Fira Sans}
\setmathrm{Fira Sans}
\setmathsf{Fira Sans}
\setmathtt{Fira Sans}
\usepackage{newtxsf}

\begin{document}
\frame{
Numbers outside of math mode: 12345.

Number in math mode: $12345$.

Capital letters in math mode: $AB\Gamma\Delta$.

Small letters in math mode: $\alpha\beta\gamma\delta$.}
\end{document}

Minuscules in sans serif, capital letters in serif font.

2
  • Just out of idle curiosity: Why \setmathtt{Fira Sans}? Wouldn't \setmathtt{Fira Mono} be more appropriate?
    – Mico
    May 18, 2020 at 9:34
  • 1
    Oh. This probably was an artifact from some other bugfix attempt. May 18, 2020 at 13:10

2 Answers 2

5

I must admit to not understanding the logic behind the instructions in the preamble of your document. The following, simpler setup would appear to work just fine:

\usepackage[no-math]{fontspec}
\setsansfont{Fira Sans}
\setmonofont{Fira Mono} % optional
\usepackage{newtxsf}

A full MWE (minimum working example):

enter image description here

Aside: If you wanted slanted rather than upright uppercase Greek letters, load newtxsf with the option slantedGreek. (uprightGreek is the default.) If, on the other hand, you want lowercase and uppercase Greek letters to be rendered using upright glyphs, load the newtxsf package with the option frenchmath.

\documentclass{beamer}
% \usepackage{amsmath} % is loaded automatically by 'beamer'
\usepackage[no-math]{fontspec}
\setsansfont{Fira Sans}
\usepackage{newtxsf}

\begin{document}
\begin{frame}
Numbers, text mode: 12345

Numbers, math mode: $12345$

Uppercase greek letters, math mode: $\Gamma\Delta\Psi\Omega$

Lowercase greek letters, math mode: $\gamma\delta\psi\omega$
\end{frame}
\end{document}
6

I would suggest the Fira Math font. It obviously pairs well with Fira Sans. Here is an example (it works for me with lualatex but doesn't work with xelatex for some reason)

\documentclass{beamer}

\usepackage{fontspec}
\usepackage{amsmath}
\setmainfont{Fira Sans}
\setsansfont{Fira Sans}
\usepackage{unicode-math}
\setmathfont{Fira Math}

\begin{document}
\frame{
Numbers outside of math mode: 12345.

Number in math mode: $12345$.

Capital letters in math mode: $AB\Gamma\Delta$.

Small letters in math mode: $\alpha\beta\gamma\delta$.

Formula:
\[
  \int_0^1\frac{dx}{1+x^2}=\lim_{n\to\infty}\sum_{i=1}^n\frac{1}{1+(i/n)^2}.
\]
}
\end{document}

enter image description here:

3
  • Thank you. This also answers my question, but unfortunately it doesn't render \mathfrak as fraktur letters (which I also need throughout my document). May 18, 2020 at 13:08
  • Yes, Fira Math doesn't have all the math glyphs yet. If I need some that is missing, I use some other font just for it. Just add \setmathfont[range=frak]{STIX Two Math} \setmathfont[range=]{Fira Math} after the \setmathfont. May 18, 2020 at 15:08
  • 1
    @Lukas GFS Neohellenic Math might be a good companion, since it has very faint slab serifs. \setmathfont[range={frak,bffrak}, Scale=MatchUppercase]{GFS Neohellenic Math}.
    – Davislor
    May 18, 2020 at 19:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .