My MWE
\documentclass[varwidth, border=0.2in]{standalone}
\usepackage{mathtools}
\usepackage{unicode-math}
\setmathfont[]{TeX Gyre Pagella Math}
\setmathfont[range={cal}]{Latin Modern Math}
\begin{document}
The distribution of $\mathbf{X}$ is $\mathcal{P}\{\mathbf{X} = k\}$.
\end{document}
produces
Note the absence of the \mathcal{P} character. Confusingly, if I comment out \usepackage{mathtools}, it appears to work:
EDIT:
I took the advice from the duplicate bug — it works, but only partly. Now I'm losing \mathscr characters, although I have the \mathcal characters back:
\documentclass[varwidth, border=0.2in]{standalone}
\usepackage{mathtools}
\usepackage{unicode-math}
\setmathfont{TeX Gyre Pagella Math}
\setmathfont[range={cal}]{Latin Modern Math}
\setmathfont[range={scr}]{TeX Gyre Pagella Math} %% Added this line
\begin{document}
The distribution of $\mathbf{X}$ is $\mathcal{P}\{\mathbf{X} = k\}$,
in the collection $\mathscr{P}$.
\end{document}
I've tried setting the math fonts in many different ways, but one of the two alphabets is always disappearing.
EDIT:
The closest I've come to a workaround is to load amsmath, then unicode-math, then mathtools. (Yes, I understand this is counter the documentation of unicode-math.) That works in that I'm able to see all my characters. Unfortunately, changing the font with \small, for example, changes all boldface math characters to non-boldface. Not ideal.





\mathcal{P}, not the script-like one\mathscr{P}? – Werner Sep 26 '16 at 06:11