I work on a big XeLaTeX document and encountered a rendering bug(?) with my MiKTeX installation (all packages are updated as per April 10, 2016). Here is a minimal example:
\documentclass{article}
\usepackage{mathtools}
\usepackage{unicode-math}
\DeclareSymbolFont{somemeaninglessname}{\encodingdefault}{\familydefault}{m}{it}
\begin{document}
\[ \mathtt{z} \]
\[ \text{$z$} \]
\[ \mathtt{z} \]
\end{document}
I'd expect first and third line to be the same. However, it's not the case:
I asked my friend to render same file on Linux with TeXLive-2014, and here is what he got:
However, if I move \usepackage{mathtools} right after \DeclareSymbolFont's line, everything works on my system as expected:
Moving it in between \usepackage{unicode-math} and \DeclareSymbolFont does nothing.
I'm not sure whether it's a bug or incorrect usage of either package. Unfortunately, I do not really understand what \DeclareSymbolFont does - it was written by another person. What is going on here?
UPD: looks like it's not MiKTeX-specific problem and happens on TeXLie 15 as well.



\usepackage{unicode-math}should go after all other math packages, as recommended in it's documentation. – Lapshin Dmitry Apr 10 '16 at 16:26\newfam \g__um_empty_famand disturbs the family detection, but I can't look deeper now. – Ulrike Fischer Apr 10 '16 at 16:49