XeLaTeX:如何删除 \binom 右括号前添加的多余空格

XeLaTeX:如何删除 \binom 右括号前添加的多余空格

代码:

\documentclass[border=1mm]{standalone}
\usepackage[alignedleftspaceno]{amsmath}

\begin{document}
$\begin{aligned}\binom{1}{2}\end{aligned}$
$\binom{1}{2}$
\end{document}

输出(红线是右括号的最左边缘应该所在的位置):

答案1

更新

该问题已在 2017 年 8 月发布的 2.17a 版中修复(使用以下代码)amsmath


昨天刚刚检查了对此问题的修复(巧合吗?)同时您可以使用以下命令在 xetex 和 luatex 情况下修复此问题:

\documentclass[border=1mm]{standalone}
\usepackage[alignedleftspaceno]{amsmath}

\makeatletter
\ifx\XeTeXcharclass\@undefined
\ifx\directlua\@undefined\else
\def\genfrac@choice#1#2{%
\ifx @#2@\else
%    \end{macrocode}
% \changes{v2.17a}{2017/09/02}{move \cs{nulldelimiterspace} correction}
%    \begin{macrocode}
\ifx c#1\kern-\nulldelimiterspace\fi
{\delimitershortfall\z@\delimiterfactor\@m
 \mathsurround\z@\nulldelimiterspace\z@
\mathchoice
{\genfrac@rule{#2}\displaystyle{2.39}}%
{\genfrac@rule{#2}\textstyle{1}}%
{\genfrac@rule{#2}\scriptstyle{1.45}}%
{\genfrac@rule{#2}\scriptscriptstyle{1.35}}%
}%
\ifx o#1\kern-\nulldelimiterspace\fi
\fi
}
\fi
\else
%    \begin{macrocode}
\def\genfrac@choice#1#2{%
\ifx @#2@\else
%    \end{macrocode}
% \changes{v2.17a}{2017/09/02}{move \cs{nulldelimiterspace} correction}
%    \begin{macrocode}
\ifx c#1\kern-\nulldelimiterspace\fi
{\delimitershortfall\z@\delimiterfactor\@m
 \mathsurround\z@\nulldelimiterspace\z@
\mathchoice
{\genfrac@rule{#2}{20}\textfont{2.39}}%
{\genfrac@rule{#2}{21}\textfont{1}}%
{\genfrac@rule{#2}{21}\scriptfont{1.45}}%
{\genfrac@rule{#2}{21}\scriptscriptfont{1.35}}%
}%
\ifx o#1\kern-\nulldelimiterspace\fi
\fi
}
\fi
\begin{document}
$\begin{aligned}\binom{1}{2}\end{aligned}$
$\binom{1}{2}$
\end{document}

相关内容