2

The \binom command doesn't work correctly with XITS and unicode-math. Here is an MWE:

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{XITS}
\setmathfont{XITS Math Regular}
\begin{document}
    \(\binom{2n}{n}\)
\end{document}

This is the output I get when I compile the file with LuaLaTeX. enter image description here

I am using TeXLive 2021.

13
  • 3
    This is a problem with the XITS Math font. Switching to \setmathfont{STIXTwoMath-Regular} (and \setmainfont{STIXTwoText-Regular} for consistency) fixes the issue. Commented Jun 18, 2022 at 17:24
  • 1
    The binomial coefficient looks fine with xits when I test in ConTeXt (both mkiv (luatex) and lmtx (luametatex)).
    – mickep
    Commented Jun 18, 2022 at 17:42
  • 2
    @mickep This probably just shows my missing ConTeXt skills, but when I tried with \setupbodyfont[xits] \starttext $\binom{2n}{n}$ \stoptext I got the same result as in LaTeX. Commented Jun 18, 2022 at 23:46
  • 1
    @MarcelKrüger, No, you have the skills, the error was mine. I did the test in display math mode, where it actually looks good. In inline math mode it does indeed look bad with luatex (but it still looks good with luametatex). Sorry for my confusion.
    – mickep
    Commented Jun 19, 2022 at 5:12
  • I did like XITS. Since there doesn't seem any other way, I have switched to STIXTwo as Daniel has said. XITS is the complete font and unicode-math supports 2427 symbols. But, unicode-math also supports 2422 symbols from STIXTwo, so it is not so bad. I like the times-like appearance of XITS though. Commented Jun 19, 2022 at 5:41

1 Answer 1

2

This is bug in the font. You can try to report it.

There is a workaround in LuaTeX if you set different registers \Umathstackdenomdown after the font is loaded:

\def\corrxits#1{\expanded{\Umathstackdenomdown#1=\the\Umathfractiondenomdown#1}\relax}
\corrxits\scriptstyle       \corrxits\crampedscriptstyle 
\corrxits\textstyle         \corrxits\crampedtextstyle
\corrxits\scriptscriptstyle \corrxits\crampedscriptscriptstyle

I did test this using OpTeX:

\fontfam[xits] % XITS + XITS math is loaded
\def\corrxits#1{\expanded{\Umathstackdenomdown#1=\the\Umathfractiondenomdown#1}\relax}
\corrxits\scriptstyle       \corrxits\crampedscriptstyle 
\corrxits\textstyle         \corrxits\crampedtextstyle
\corrxits\scriptscriptstyle \corrxits\crampedscriptscriptstyle

$
  %\scriptstyle
  {2n\choose n}, \quad a_{2n\choose n}, \quad {2n\over n}, \quad {2n\atop n}
$
\bye

Thanks to Marcel Krüger for reminder cramped styes.

0

You must log in to answer this question.

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