0

There's a sans-serif font called "Inter" which I use as the main font in my document. I would like to use its glyphs in math mode.

I searched some methods of doing it, but with them there were some inconsistencies, which bothered me a lot, so I have I unhappily changed to a serif font (STIX Two Math), but I still want the Inter characters.

Anyone has the knowledge of a form to get these glyphs nicely in the math mode?

It seemed strange to me the fact that there's so few sans-serif math fonts, and I don't know for sure if it's something related to the influence of a tradition or some other recurring human tendency/preference.

Minimal working example:

\documentclass{scrartcl}

\usepackage[sfdefault]{inter}
\usepackage[math-style=upright]{unicode-math}
\setmathfont{STIX Two Math}

\begin{document}
\noindent Example of math text ahead:\\
  \Large $\gamma = \frac{1}{\sqrt{1 - \frac{v^2}{c^2}}}$
\end{document}

Thanks.

7
  • 3
    In my experience, using serif fonts for math is a strong tradition. However, there are a few sans serif letters that are specified by international standards to mean particular things, most often in physics contexts (if I remember correctly). So you need to be aware of your audience. Feb 1 at 3:42
  • A sans font that you can use immediately is NotoSansMath. Peeking at the code at github you might get the python script to change inter to a math font as well, if it has the glyphs or substitute from the Noto font. Although I agree with @barbarabeeton that it is unconventional.
    – yannisl
    Feb 1 at 4:26
  • @barbarabeeton I wasnt't sure how to ping you, but can you please have a look at this tex.stackexchange.com/questions/706288/… I would love to have your input.
    – yannisl
    Feb 1 at 4:40
  • 1
    tex gyre hermes math, firamath, heros math are reasonable opentype sans serif math fonts, have you tried them? sadly noto sans math is essentially a serif font despite its name. Feb 1 at 8:59
  • @yannisl -- I've left a comment there. You can usually ping me on the chat. Some of the rules I mentioned were stated in a document from the US National Institute of Standards and Technology, but that document has been superseded, and finding a link for the original isn't straightforward. But I will try, and will post it. Feb 1 at 14:48

1 Answer 1

2

There are several Sans Serif OpenType math fonts available, this is Inter text with Fira Math for example

enter image description here

\usepackage[sfdefault]{inter}
\usepackage[math-style=upright]{unicode-math}
\setmathfont{Fira Math}

\begin{document}
\noindent Example of math text ahead:\\
  \Large $\gamma = \frac{1}{\sqrt{1 - \frac{v^2}{c^2}}}$
\end{document}

You could also use the unicode-math Range key to substitue Inter for some ranges of characters although they would inherit the text spacing not have the usual wider sidebearings of math fonts

and here it is with Inter used for math letters (although unicode-math does moan that Inter isn't really set up as a math font it does what is asked)

enter image description here

\usepackage[sfdefault]{inter}
\usepackage[math-style=upright]{unicode-math}
\setmathfont{Fira Math}
\setmathfont[range=up]{inter}

\begin{document}
\noindent Example of math text ahead:\\
  \Large $\gamma = \frac{1}{\sqrt{1 - \frac{v^2}{c^2}}}$
\end{document}

With warnings such as

Package fontspec Warning: OpenType feature 'Style=MathScript' (ssty) not
(fontspec)                available for font 'inter' with script
(fontspec)                'CustomDefault' and language 'Default'.

as Inter isn't really a math font, although that is not so important here as the main math typesetting parameters are taken from FiraMath

1
  • Hi, thanks for the solution. I wish there were more "pure" Sans Serif fonts, I like its "clean", homogeneous and "only essential" form, which pleases me. The "soul" in the serifed fonts somehow bothers me. Feb 7 at 16:25

You must log in to answer this question.

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