latex3 / unicode-math

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

\not problem with unicode-math #363

Closed mjsharpe closed 6 years ago

mjsharpe commented 8 years ago

Processing with xelatex, $\not\propto$ just prints 6 before $\propto$, rather than overlaying combining solidus.

cpitclaudel commented 8 years ago

Just came here to report the same thing; I asked about it at https://tex.stackexchange.com/questions/324427/unicode-math-replaces-not-by-the-number-6

eg9 commented 8 years ago

The “6” is due to the fact that, in the case of \not\propto, \__um_oldnot: is used, which is defined as the legacy \not mathchar, so \mathchar"3236. Since in math family 2 the unicode math font is used, character U+0036 is used (which is a 6).

cpitclaudel commented 8 years ago

@eg9 Thanks! Do you want to write a response to that question? That would be very useful :)

u-fischer commented 8 years ago

The "6" instead of a sensible slash is due to the fact, dass the definition of \not is not correctly saved when unicode-math-tables is processed. With e.g. this here it works again:

\ExplSyntaxOn
\cs_set:Nn \__um_input_math_symbol_table: {\g__um_mathtable_tl
                                           \cs_set_eq:NN\__um_oldnot:\not
                                           }
\ExplSyntaxOff

But this alone doesn't lead to a good \not. Imho the mathaccent definition is wrong, one need the overlay key word for the correct placement.

\documentclass{article}

\usepackage{fontspec}
\usepackage{amsmath,amssymb}

\usepackage{unicode-math}

\ExplSyntaxOn
\cs_set:Nn \__um_input_math_symbol_table: {\g__um_mathtable_tl
                                           \cs_set_eq:NN\__um_oldnot:\not
                                           }
\ExplSyntaxOff

\begin{document}
Bad:  $A \not\approxeq B $

\newcommand\napproxeq{\Umathaccent overlay fixed  7\symoperators "00338 \approxeq}

Good: $A \not\approxeq B $

\end{document}

notoverlay

khaledhosny commented 8 years ago

Does XeTeX support the overly keyword? It seems like a new LuaTeX addition.

u-fischer commented 8 years ago

Ups, I didn't realize that the question started with a reference to xelatex. My comments/code were meant for lualatex which knows the overlay keyword. For xelatex I don't know if there is a way to better place the solidus.

khaledhosny commented 8 years ago

Ideally XeTeX should add support for the overlay keyword, because AFAIK there was no clean way to place such overlay accents in math mode at the engine level.