TransWikia.com

`range` option not working properly in `setmathfont`

TeX - LaTeX Asked by Tuff Contender on August 1, 2021

I want to use XITS Math font for numbers and Latin Modern Math by default. But

documentclass{article}
usepackage{unicode-math}
setmathfont{Latin Modern Math}
setmathfont{XITS Math}[range={`0-`9}]

begin{document}
1234567890
$ x^{2}+y^{2}=z^{2}, xialphabeta, 1234567890 $
end{document}

produces
enter image description here

A magic number "0391 helps to generate the intended output

documentclass{article}
usepackage{unicode-math}
setmathfont{Latin Modern Math}
setmathfont{XITS Math}[range={`0-`9,"0391}]

begin{document}
1234567890
$ x^{2}+y^{2}=z^{2}, xialphabeta, 1234567890 $
end{document}

enter image description here

All effective numbers are "0391-"03A1,"03A3-"03AF,"03B1-"03BF,"03F4,"2202,"2207,"1D434-"1D454,"1D456-"1D467,"1D6E2-"1D6FA,"1D6FC-"1D714.

Why are these numbers so special?

One Answer

The syntax for this is:

documentclass{article}
usepackage{unicode-math}
setmathfont{Latin Modern Math}
setmathfont{XITS Math}[range={up/num,
                               bfup/num},
                        Scale=MatchUppercase]

begin{document}
1234567890
$ x^{2}+y^{2}=z^{2}, xialphabeta, 1234567890 $
end{document}

You can look up the meaning of those Unicode codepoints in the symbol list. It doesn’t look as if the package is correctly parsing the expression `0-`9 on its own, but it does understand slight variations.

Answered by Davislor on August 1, 2021

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