Why do numbers in \mathnormal not match numbers without it?

math mode consists (in classic TeX) of 16 math font families and each character is assigned a default family and optional allowed to vary the family in the scope of a command like \mathbf or \mathnormal.

In the default setup digits come from the operator family (normally upright roman font) but \mathnormal forces the default math italic font used for letters and that is where the old style numbers are in the default tex encoding.


As you can see in the Font Guide (on page 11), \mathnormal uses the cmm font family. This stands for Computer Modern Math Italic (page 4). As David explained, numbers in regular math are taken from the operators family, which is cmr (Computer Modern Roman).

With the fonttable package you can see the glyphs for the different families, using the attributes from the table on page 11 of the Font Guide as arguments for the \xfonttable command. MWE:

\documentclass{article}
\usepackage{fonttable}
\begin{document}
\xfonttable{OT1}{cmr}{m}{n}
\xfonttable{OML}{cmm}{m}{it}
\end{document}

cmr numbers:

enter image description here

cmm numbers:

enter image description here


Package-writing and Unicode fonts add further overlays and permutations to the conventions:

sample

MWE

\documentclass{article}
\usepackage{xcolor}

\usepackage{unicode-math}
\setmainfont{Noto Sans}[Colour=red]
\setmathfont{XITS Math}[Colour=blue]
\begin{document}

0123456789 abc ABC αβγ

\(0123456789 abc ABC αβγ\)

\( \mathnormal{0123456789 αβγ} αβγ\)

\( \mathrm{0123456789 αβγ} αβγ\)

\( \textrm{0123456789 αβγ} αβγ\)

\( \mathit{0123456789 αβγ} αβγ\)

\end{document}