# unicode-math breaks \not command

\documentclass{scrartcl}

\usepackage{fontspec}

\usepackage{mathtools}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}

\begin{document}
$\not\propto$
\end{document}


Results in:

How can I solve this?

• Yes, it's broken; in this case it uses \mathchar"3236 which is of course the wrong thing to do, because it indeed simply prints a 6 considered as a relation symbol. On the other hand, Unicode defines no symbol that could take place of \not, as far as I can see; there is U+0338, but it doesn't behave, in my experiments. Sep 16, 2015 at 9:39
• unicode will never define a symbol that adequately takes the place of \not; the tex "dead key" approach does not fit the unicode model. besides, the shape of the \not symbol is already inadequate in the tex model, as can be seen from the many \nXXXX symbols provided. \nprop isn't one of them. so this is best handled by defining such a composite and using that. Sep 16, 2015 at 14:22

unicode-math is already checking to see if \npropto is defined (it is not, in this case) and only falls back to overprinting if it is not defined. It uses the original definition (saved as \__um_oldnot:) which isn't really appropriate here, rather than redefine \not to do something else as a fallback, cheat a bit and redefine the saved \__um_oldnot: to overprint a /.

For any command where the negation combination doesn't look good, simply define \nxxx to do something else, the example below shows a default positioning and then the effect if you define \npropto to use a vertical stroke,

\documentclass{scrartcl}

\usepackage{fontspec}

\usepackage{mathtools}
\usepackage{unicode-math}

\ExplSyntaxOn
\def\__um_oldnot:#1{\mathrel{%
\mathchoice
{\rlap{$\displaystyle\mkern1mu/$}}%
{\rlap{$\textstyle\mkern1mu/$}}%
{\rlap{$\scriptstyle/$}}%
{\rlap{$\scriptscriptstyle/$}}%
{#1}}}
\ExplSyntaxOff

\setmathfont{Latin Modern Math}

\begin{document}

$a \not\propto b$

\newcommand\npropto{\mathrel{|\mkern-12mu\propto}}

$a \not\propto b$

\end{document}