I am writing thesis, using XeLaTeX with unicode-math
, documentclass is modified memoir
. I need to typeset equations with binomial coefficient, however I get wrong sizes of parentheses around them.
And unicode-math
seems to be ruining the output of \binom
, \choose
,
\genfrac
, etc.
When I do:
$$\binom{n}{k}\qquad \tbinom{n}{k} \qquad \dbinom{n}{k}$$
$$\binom{5}{6}\qquad \tbinom{5}{6} \qquad \dbinom{5}{6}$$
I get binomial coefficient with too small parentheses around it:
I’ve tried renewcommand
ing binom
by:
\renewcommand{\binom}[2]{\genfrac{(}{)}{0pt}{}{#1}{#2}}
with no success, however placing it between \left(
and \right)
gives correct bigger parentheses.
I have set non-standard fonts (see below), but disabling them doesn’t change this.
Using {n \choose k}
gives the very same output… How to overcome this problem?
Minimal code generating this is:
\documentclass[a4paper,oneside]{memoir}
\usepackage{amsmath,unicode-math,xltxtra}
% Those are needed to use same fonts as I do.
% Parentheses are strange even without them
%\setromanfont[Mapping=tex-text]{Linux Libertine O}
%\setsansfont[Mapping=tex-text]{Ubuntu}
%\setmonofont{Ubuntu Mono}
%\setmathfont{Latin Modern Math}
%\setmathfont[range=\mathit/{latin,Latin,num,Greek,greek}]{Linux Libertine O Italic}
%\setmathfont[range=\mathup/{latin,Latin,num,Greek,greek}]{Linux Libertine O}
%\setmathfont[range=\mathbfup/{latin,Latin,num,Greek,greek}]{Linux Libertine O Bold}
%\setmathfont[range={"221E}]{Linux Libertine O}% "0221E = \infty
\begin{document}
$$\binom{n}{k}\qquad \tbinom{n}{k} \qquad \dbinom{n}{k}$$
$$\binom{5}{6}\qquad \tbinom{5}{6} \qquad \dbinom{5}{6}$$
\end{document}
EDIT: Simple working workaround
Redefining \binom
this way makes it look acceptably, at least for my set of fonts:
\renewcommand{\dbinom}[2]{\left(\!\!\begin{array}{c}{#1} \\ {#2} \end{array}\!\!\right)}
\let\oldbinom\binom
\renewcommand{\binom}[2]{\mathchoice{\dbinom{#1}{#2}}{\oldbinom{#1}{#2}}{\oldbinom{#1}{#2}}{\oldbinom{#1}{#2}}}
\renewcommand{\dbinom}[2]{\left(\!\!\begin{array}{c}{#1} \\ {#2} \end{array}\!\!\right)}
every time in displaystyle, instead of\binom
. – silmeth Sep 28 '15 at 18:00\binom
macro, rather than redefine\dbinom
and then change the code. Look at\mathpalette
and\mathchoice
. Plus, I've always had problems with the fences in\binom
… in any compiler. – Manuel Sep 28 '15 at 18:20\renewcommand{\dbinom}[2]{\left(\!\!\begin{array}{c}{#1} \\ {#2} \end{array}\!\!\right)} \let\oldbinom\binom \renewcommand{\binom}[2]{\mathchoice{\dbinom{#1}{#2}}{\oldbinom{#1}{#2}}{\oldbinom{#1}{#2}}{\oldbinom{#1}{#2}}}
Works good, with regular\binom
in displaystyle. :) (added it to question, maybe will help somebody later) – silmeth Sep 28 '15 at 18:36unicode-math
is based, are still beta, and there are some problems that have come up in testing; one such problem is the sizing of delimiters in matrices and\binom
. this is being worked on. – barbara beeton Oct 3 '15 at 22:12\binom
and friends is dependent on two parameters which have no counterparts in the otf (opentype font) math table. this is being studied now; it is not an easy problem to solve or work around. the two "obvious" approaches are (1) change the tex program (not going to happen) or (2) upgrade the otf math table (serious political difficulties). so, for the moment, on hold. – barbara beeton Apr 21 '16 at 20:18