What can i put into \setmathfont{<...>.otf}
for the unicode-math
package to make it all work (with XeLaTeX or LuaLaTeX)?
There are several suggestions on the GitHub page of unicode-math
, but the first option is commercial, and the second and the third do not work with the following example:
% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{unicode-math}
\setmathfont{latinmodern-math.otf}
% \setmathfont{texgyrepagella-math.otf}
% \setmathfont{xits-math.otf}
\begin{document}
$X\setminus Y$
\end{document}
I do not get the \setminus
character in the output.
The \setminus
character is also missing if i do not set a math font at all (i do not know which font is used in this case). It works with xits-math
, but i do not like it.
Is it expected by the way that the \setminus
character is left blank without giving any warning?
Best Answer
It's quite strange that the symbol is missing in Latin Modern Math, TeX Gyre Termes Math and TeX Gyre Pagella and it's probably worth a bug report.
You can supplement single symbols with the
range
option to\setmathfont
:A different possibility is to use
\backslash
made into a binary operator:that gives
In this case
would make
\setminus
doing what's expected. However, the redefinition must be issued at begin document, becauseunicode-math
prepares its internal math symbol tables at that moment.