使用 unicode-math 时缺少上划线和额外的水平空格

使用 unicode-math 时缺少上划线和额外的水平空格

这是我的 MWE:

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

\newcommand\closure[1]{\overline{#1}}

\begin{document}

The intersection of the closed ball $\overline{B}(1)$ with the closed 
ball $\closure{B}(2)$ is the same as the intersection of the closed
ball $\closure{B}(2)$ with the closed ball $\overline{B}(1)$.

\end{document}

这就是我所看到的(带有xelatex): 在此处输入图片描述

请注意“B(2)”之前的多余空格和缺失的上划线。

当我注释掉时问题就消失了\usepackage{unicode-math}

答案1

原因是unicode-math默默地重新定义\closure以产生角色

⁐ U+2050 特写

这似乎是一个“隐藏的功能”。

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

\AtBeginDocument{%
  \providecommand{\closure}{}%
  \renewcommand\closure[1]{\overline{#1}}% 
}

\begin{document}

The intersection of the closed ball $\overline{B}(1)$ with the closed
ball $\closure{B}(2)$ is the same as the intersection of the closed
ball $\closure{B}(2)$ with the closed ball $\overline{B}(1)$.

\end{document}

在此处输入图片描述

相关内容