I'd like to use Fira Sans as the main font because it has awesome math support, but I'd like to use other fonts as well, which is why I'd like to use XeLaTeX with the fontspec package. However, it appears to change the font here and there and I don't know why.
Here's a MWE:
\documentclass[]{article}
\usepackage[T1]{fontenc}
\usepackage[sfdefault]{FiraSans}
\usepackage{newtxsf}
\begin{document}
Writing numbers 12345 in line and in $12345$ math mode using the font Fira Sans.\\
Some math:
\begin{align*}
\lim_{n \to \infty} \sum_{k=0}^4 a_0 q^k
\end{align*}
\end{document}
Best Answer
On XeTeX, the
Firasans
package loadsfontspec
, which sets up the\mathrm
font in a way that breaks withsfdefault
. This is a bug in theFiraSans
package.One solution is to use modern OpenType fonts with
fontsetup
(which loads Fira Math inunicode-math
):I recommend you use OpenType fonts when you can, and legacy 8-bit packages when you have to.
If you want to use your legacy math font with Fira Sans, you can turn off the redefinition of
\mathrm
, which is used as the operator font for\lim
, infontspec
before you loadFiraSans
:You could also fix
\mathrm
afterwards with\setmathrm
, as\usepackage[sfdefault]{FiraSans]
should have done.