How can I change the font used for just one glyph without affecting any other glyph ?
I recently switched from pdfLaTeX to XeLaTeX and fontspec and unicode-math.
I am using TeX Gyre Pagella as my main math font but I do not like the glyph for the empty set so I want to use the glyph from Asana Math for this symbol.
I am trying to achieve this with the range feature of unicode-math as per Section 4.1 of its manual :
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{texgyrepagella-math.otf}
\setmathfont{Asana-Math.otf}[range={\emptyset}]
\begin{document}
$\emptyset\mathbb N\BbbN$
\end{document}
This does not give the result I expected :
The emptyset symbol still comes from Pagella, and the \mathbb
alphabet has been changed to the one from Asana.
Changing the range to [range={\varnothing}]
does give the correct emptyset symbol (which I find strange, but it works !) but still has unintended consequences :
I tried to change the range to [range=up/{\varnothing}]
to indicate that I only want to affect the upshape font, but this does not compile :
! Undefined control sequence.
\l__um_alphabet_tl ->\varnothing
l.5 ...ont{Asana-Math.otf}[range=up/{\varnothing}]
Note : unicode-math if v0.8f and fontspec is v2.6d, from TexLive 2017.
Edit about a previously accepted solution
The workaround with [range={\int}]
causes unwanted space with delimiters :
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{texgyrepagella-math.otf}
\setmathfont{Asana-Math.otf}[range={\varnothing}]
\setmathfont{texgyrepagella-math.otf}[range={\int}]
\begin{document}
$\big||a| - |b|\big|\leq|a-b|$
\end{document}
The empty-range trick described there has the same effect.