[luatex] bad \Umathfractiondelsize calculation

Petr Olsak petr at olsak.net
Sat Jun 6 09:43:30 CEST 2020


When I load Unicode math Latin Modern with LuaTeX and try:

     $$ {n \atopwithdelims() k} $$ % i.e. {n \choose k}

then the result looks ugly, the brackets are too big.

The size of these brackets depend on the 
\Umathfractiondelsize\displaystyle prameter.

This parameter is is set to 24.0pt by LuaTeX when the Unicode 
latinmodern-math font at 10pt is loaded. I tried to use fontforge:

fontforge latinmodern-math.otf

menu: Element / Font info, tab: TeX, select: TeX math symbol, click: 
"more params". We can see that fontforge suggests the Delim1 (this is 
the same parameter) as 2390, i.e. 23.9 pt when the font is loaded at10pt.

If I correct it:

      \Umathfractiondelsize\displaystyle=23.9pt

      $$ {n \atopwithdelims() k} $$

then the result looks OK.

I know that this parameter is not present in Unicode MATH table (see 
fontforge menu: Element / Other info / Math info), but the calculation 
done by fontforge to the suggestion of this parameter for TeX is better 
than in LuaTeX. I don't know the internal algorithm in fontforge nor in 
LuaTeX for initializing this parameter, but it would be good idea to 
compare them and do correction in LuaTeX.

Notice about Unicode math loading. I did the Unicode Math loading for 
this test in OpTeX:

     \fontfam[lmfonts]

    \the\Umathfractiondelsize\displaystyle
    $$ {n \atopwithdelims() k} $$

     \bye

or in LuaLaTeX:

    \documentclass{article}
    \usepackage{unicode-math}
    \begin{document}

    \the\Umathfractiondelsize\displaystyle
    $$ {n \atopwithdelims() k} $$

    \end{document}

or in ConTeXt:

     \starttext

     \the\Umathfractiondelsize\displaystyle

     $${n\atopwithdelims() k}$$

     \stoptext

The last one shows the result 28.8pt and ugly combination number because 
the default size is 12pt here, 24.0*1.2 = 28.8pt.

Petr Olsak




More information about the luatex mailing list.