# Using multiple math fonts causes characters and spacing problems with delimiters

I am using Pagella as my main math font but MnSymbol for the \mathcal font and this has strange interactions.

The following code

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{texgyrepagella-math.otf}
\setmathfont[range={cal}]{MnSymbol}
\begin{document}
$\big||a| - |b|\big|\leq|a-b|$
\end{document}


compiles to

In relation with the answer that worked well for my previous problem with the range feature of unicode-math, I tried

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{texgyrepagella-math.otf}
\setmathfont[range={cal}]{MnSymbol}
\setmathfont[range={up,it,tt,bb,frak, scr}]{texgyrepagella-math.otf}  %% NEW
\begin{document}
$\big||a| - |b|\big|\leq|a-b|$
\end{document}


which improves things but leaves some ununderstandable space :

I would like this inequation to look like this (achieved by not using MnSymbol at all, but I want it for my mathcal !)

Note : in this example, replacing the explicit \big by \left and \right gives a correct output, even without the workaround. But this \left. \frac12 \right) gives the same strange glyph for the left delimiter (although the workaround eliminates this one !).

Use \setmathfontface to setup up a \mathXX font:

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{texgyrepagella-math.otf}
\setmathfontface\mathcal{MnSymbol}[]

\begin{document}
$\mathcal{A} \big||a| - |b|\big|\leq|a-b|$
\end{document}


• Thanks. This works --- what is the point of the cal range in unicode-math then ? Alas, the workaround in the referred question still causes the "additional spacing" problem. I am going to unaccept and comment there. – ysalmon Aug 23 '17 at 14:36
• The cal-range is mainly there to change the \symcal-font and changes \mathcal in a sort of side effect. But the range option is as I already mentioned buggy and difficult to handle with math fonts. With non-math fonts (like MnSymbol) it is simply a pain. – Ulrike Fischer Aug 23 '17 at 14:50