7

I am currently trying to get all numbers in math mode in italics. However, I find no way of re-defining the numbers 0,1,2,3,4,5,6,7,8,9 to make them italics as long as they are in a math environment. I am using the Fourier font, both for text and math. Though it's not quite useful, here is a small MWE.

\documentclass{article}
% PACKAGES LOADING
\usepackage[sloped]{fourier} % To customise font.
\begin{document}
$0123456789$
\end{document}

The numbers in the output (below) are of course not in italics, which is what I wish.

enter image description here

Any help will be appreciated.

PS: I am aware that this may be considered bad typesetting practices, but I want to see how it looks in my document anyway.

PS2: I found several closely-related questions in the site; but none of them addressed this question in particular. If this is already answered in the site; I am sorry: I never saw it in my search.

1 Answer 1

13

enter image description here

normally you would have been able to allocate digits to the letter alphabet but that doesn't seem to give italic digits in this setup, so I allocated a new math alphabet.

\documentclass{article}
% PACKAGES LOADING
\usepackage[sloped]{fourier} % To customise font.
\DeclareSymbolFont{mathit}{T1}{fut\mathfamilyextension}{m}{it}%

\DeclareMathSymbol{0}{\mathord}{mathit}{`0}
\DeclareMathSymbol{1}{\mathord}{mathit}{`1}
\DeclareMathSymbol{2}{\mathord}{mathit}{`2}
\DeclareMathSymbol{3}{\mathord}{mathit}{`3}
\DeclareMathSymbol{4}{\mathord}{mathit}{`4}
\DeclareMathSymbol{5}{\mathord}{mathit}{`5}
\DeclareMathSymbol{6}{\mathord}{mathit}{`6}
\DeclareMathSymbol{7}{\mathord}{mathit}{`7}
\DeclareMathSymbol{8}{\mathord}{mathit}{`8}
\DeclareMathSymbol{9}{\mathord}{mathit}{`9}
\begin{document}
$0123456789$
\end{document}
9
  • Wouldn't it be better \mathalpha? Also \DeclareSymbolFontAlphabet is needed.
    – egreg
    Mar 26, 2017 at 13:00
  • @egreg well \mathalpha or \mathord depends on the definition of "All" in the question. Not sure about \DeclareSymbolFontAlphabet? that's for making a \mathxxx alphabet command out of a symbol font but this needs the other way I've declared a symbol font, oh you mean redeclare \mathit to use this and save a fam? I suppose so... Mar 26, 2017 at 13:05
  • 1
    @Héctor as it is the digits will always be in that font even if you use \mathrm{1} etc if it was \mathalpha instead then they would start in that font but obey font change commands Mar 26, 2017 at 13:40
  • 1
    @Héctor yes.... Mar 26, 2017 at 13:45
  • 1
    @Héctor not easily (anything is possible of course, you could make them active and look ahead for ) but the more tricky macros you add the more things will break) Mar 30, 2017 at 10:02

You must log in to answer this question.

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