After last Khaled's comment, here's something that seems to work
\Umathchardef\xnot="3 \symoperators "0338
\AtBeginDocument{
\renewcommand\not[1]{#1\xnot}
\renewcommand{\notin}{\not\in}
}
Then
$a\not\in b \notin c$
will work (although the placement doesn't seem to be optimal).
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}
\Umathchardef\xnot="3 \symoperators "0338
\AtBeginDocument{\renewcommand\not[1]{#1\xnot}
\renewcommand{\notin}{\in\xnot}}
\begin{document}
$a \not\in S_{\not\in}$
$a\in\xnot b \notin c$
$a\in b \in c$
\end{document}
A possible improvement is to say
\Umathchardef\xnot="3 \symoperators "0338
\AtBeginDocument{
\renewcommand\not[1]{#1\mathrel{\mkern1mu}\xnot}
\renewcommand{\notin}{\not\in}
}
that pushes the slash slightly to the right, so that the upper end is lined up with the terminators of the \in
symbol.
Note: this definitely doesn't work with XITS Math or Asana Math, which, however, have the proper symbol.
UPDATE
As of January 2013, the problem seems to be solved; here's the minimal example:
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}
\begin{document}
$a \not\in S_{\not\in}$
$a \notin S_{\notin}$
\end{document}
Both LuaLaTeX and XeLaTeX give the correct result.
FURTHER UPDATES
The code was broken again, but version 0.8j of unicode-math
seems to have fixed the issues.
Use mathrm=sym
to force unicode-math
to use the math font:
\documentclass{article}
\usepackage[mathrm=sym]{unicode-math}
\DeclareMathOperator{\Rank}{Rank}
\DeclareMathOperator{\Nullity}{Nullity}
\setmainfont{Roboto}
\begin{document}
\[\Rank A + \Nullity A = c\]
\[\lim_{h\to 0}\frac{f(x+h) - f(x)}{h}\]
\end{document}
An alternative is to set the mathrm font to a better text font or e.g. to the math font itself:
\documentclass{article}
\usepackage{unicode-math}
\DeclareMathOperator{\Rank}{Rank}
\DeclareMathOperator{\Nullity}{Nullity}
\setmainfont{Roboto}
\setmathrm{Latin Modern Math}
\begin{document}
\[\Rank A + \Nullity A = c\]
\[\lim_{h\to 0}\frac{f(x+h) - f(x)}{h}\]
\end{document}
Best Answer
TeX Gyre Termes Math has blackboard bold letters similar to the
amsfonts
ones:Here's the result if XITS Math is used intead of Termes:
Just take your pick; you can experiment also with TeX Gyre Pagella Math or Asana Math.