# Missing overline and extra horizontal space when using unicode-math

Here's my 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}


This is what I'm seeing (with xelatex):

Note the extra space before "B(2)" and the missing overline.

The problem goes away when I comment out \usepackage{unicode-math}.

The reason is that unicode-math silently redefines \closure to yield the character

⁐ U+2050 CLOSE UP

which seems to be a “hidden feature”.

\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}


• – egreg Aug 16 '18 at 21:24
• Excellent! Thank you for the quick response. – Derek Aug 16 '18 at 22:20