2

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

base code

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 : trying to improve things

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

desired output

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 !).

3

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}

enter image description here

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.