latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
245 stars 29 forks source link

\not\SomeSymbolRepresentedByAMacro does not work #455

Open blefloch opened 6 years ago

blefloch commented 6 years ago

Description

Placement of the \not slash is incorrect in XeTeX with unicode-math when the argument of \not is a macro expanding to a character. This was first reported at https://sourceforge.net/p/xetex/bugs/128/ (but the subscript included in that issue is extraneous). The bug does not show up in LuaTeX. It does not show up without unicode-math.

Check/indicate

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{unicode-math}
\newcommand{\pSymbol}{\prec}
\begin{document}
$(\not\prec_a) (\not\pSymbol_a)$
\end{document}
u-fischer commented 6 years ago

You get the same output for both variants if you also define a \npSymbol command. xetex can then use the real, correct glyph:

\documentclass{article}
\usepackage{unicode-math}
\newcommand{\pSymbol}{\prec}
\newcommand{\npSymbol}{\nprec}
\begin{document}
$(\not\prec_a) (\not\pSymbol_a)$
\end{document}

image

Regarding the bad placement when the command doesn't exist: xetex is imho still missing the overlay keyword existing in luatex and so it can't probably not be done better. See https://github.com/wspr/unicode-math/issues/363.