0

I need to use Tex Gyre Adventor as a font in my documents. This font has no math font, so I'd like to use the numbers of that font in math mode.
I managed to do it using \setmathfont[range=up/{num}]{TeX Gyre Adventor}, as indicated in the documentation of unicode-math.

My problem is that the numbers in math mode are bigger than the letters. Here is below an example.

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Adventor}
\setmathfont{xits-math}
\setmathfont[range=up/{num}]{TeX Gyre Adventor}
\begin{document}
In text mode: 3\,z.

In math mode: $3\,z$.
\end{document}

Result of the code

Is there any way to change the size of the xits font only, so it has the same size as the Tex Gyre Adventor font ?

Thank you,
Régis

0

I'm sorry, I found the solution on this very site : https://tex.stackexchange.com/a/210074/63033

I post it here in case anyone is interested :

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Adventor}
%\setmathfont{xits-math}
\setmathfont[Scale=1.2]{xits-math}
\setmathfont[range=up/{num}]{TeX Gyre Adventor}
\begin{document}
In text mode: 3z

In math mode: $3z$.
\end{document}

I just had to had the Scale parameter to \setmathfont{xits-math}.

  • 1
    Better yet, add \defaultfontfeatures{ Scale = MatchLowercase } and then load the main font with [Scale=1.0]. Then you don’t need to guesstimate the correct scaling. You can load a font with [Scale=MatchUppercase] if you’ll be using it for things like numbers or uppercase letters. – Davislor Jul 24 at 19:37

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.