I frequently use the abbreviation \nin with the definition
\newcommand{\nin}{\not\in}
However, when I started doing this using xelatex and unicode-math it causes xelatex to stall. In particular the following document seems to put xelatex into an infinite loop
\documentclass{amsart}
\usepackage{unicode-math}
\newcommand{\nin}{\not\in}
\begin{document}
\( a \nin b \)
\end{document}
Frankly I'm quite puzzled as my command is defined after all packages are loaded (still fails even if I define the command after begin document) and no existing command collides with it so what is going on?
Is there any way that I can make this macro work (ideally in a way that works in both xelatex+unicode-math and pdflatex)
Just to be clear it is the definition of \nin plus the use of \not\in that causes trouble as if I replace.
\( a \nin b \)
with
\( a \not\in b \)
it still stalls but if I instead replace it with
\( a \in b \)
it executes fine.
Pursuant to egreg's comment I can define \nin as \notin and everything compiles fine. I would, however, still like to know what is going on here so I won't run into the same problem again.
\not\in
has been wrong since day 1 and should be\notin
. – egreg Mar 29 '17 at 6:17