TransWikia.com

Why do numbers in mathnormal not match numbers without it?

TeX - LaTeX Asked on November 23, 2020

Why do numbers typeset with mathnormal{...} not give the same result as numbers typeset without it? The documentation here leads me to think they should be the same. I’ve searched this site and the closest question I’ve found is this one but this specific issue is never addressed. I don’t need a fix; I only want to know why the difference exists.

MWE:

documentclass{article}

begin{document}
(0123456789)

( mathnormal{0123456789} )
end{document}

Compiled MWE

3 Answers

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.

Correct answer by David Carlisle on November 23, 2020

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

Answered by Marijn on November 23, 2020

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}

Answered by Cicada on November 23, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP