Say I need to use a certain sans serif font (not Arial, but I am using this in the example, because it is widely available). As a consequence, I need to use a sans serif math font.
The main font obviously does not have the full math palette, so I need a sans serif math. My idea was to use the arevmath
package, because I like the symbols and think they fit quite well -- except for the numbers. So my idea was to use unicode-math
in order to use upright numbers and latin letters from the main font.
\documentclass{article}
\usepackage{fontspec}
\usepackage{arevmath}
\usepackage{unicode-math}
\setmainfont{arial}
%\setmathfont{firamath} %% <--- using this, it will work
\setmathfont{arial}[range={up/{num,latin}}]
\begin{document}
test 123 $123$
\end{document}
The above code yields the following error:
Package unicode-math Error: No main maths font has been set up yet.
(unicode-math) If you simply want ‘the default’, use:
(unicode-math) \setmathfont{latinmodern-math.otf}
I suppose this comes from the fact that arevmath
uses "classic" LaTeX font selection methods whereas unicode-math
relies on newer techniques, so the font is not properly "registered".
If I uncomment the line \setmathfont{firamath}
, it works, except that IMHO the fonts do not match very well.
How can I use Arev (and associates) for mathematical symbols, but still use the main font for numbers and latin letters?
arevmath
does work flawlessly, but then arev is used for all maths including numbers and latin letters. As these are (of course) available in the main font, I was hoping to use them instead of the ones from arev, because they do not match well. (I also tried GFS NeoHellenic, but the problem is the same, and I find the font too "serif-fy" for a sans font. So basically, the fonts used byarevmath
cannot be used withfontspec
?