5

I want to use the font Fira Sans for my document, but this font has only "old-style" numbers. I was wondering if it was possible to change only the numbers' font so it would be different from the alphabetical characters.

I searched a lot but all answers I could find would only change the font in math mode using \DeclareMathSymbol, I want this modification to affect all the document.

Thank you.

PS: I realize I could just use another font which has regular numbers, but I want to know (no matter the extra work) if its feasible.

  • 7
    Welcome to TeX.SX! If I call \usepackage[sfdefault,lining]{FiraSans}, the numbers are lining. – egreg Sep 6 '15 at 22:28
  • And the opentype font supports at least 4 different styles of figures: oldstyle, lining, proportional and tabular (2x2). The FiraSans package also supports the 2x2 set of possibilities. – cfr Sep 7 '15 at 1:17
  • The solutions by @egreg sets the lining (proportional, ...) style of figures for the whole document. Is there an easy way to change the lining of the math mode only - to retain readability throughout the text, but align numbers within specific equations? – tipavi Jan 16 '18 at 13:14
  • @tipavi In unicode-math, you can \setmathfont[range=up/Digits, Numbers={Lining, Proportional}, Scale=MatchUppercase]{Fira Sans}. You could also try the experimental Fira Math font. – Davislor May 16 at 18:43
0

With XeLaTeX and fontspec it's fairly easy :

\usepackage{fontspec}
\setmainfont[]{Fira Sans}
\setmathrm[]{Anotherfont}

Or you could check your font and the doc of Fontspec to edit \setmathrm[]{Fira Sans} with the adequate options if it's available.

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.