5

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:

MiKTeX rendering result

I asked my friend to render same file on Linux with TeXLive-2014, and here is what he got:

TeXLive rendering result

However, if I move \usepackage{mathtools} right after \DeclareSymbolFont's line, everything works on my system as expected:

Fixed MiKTeX render

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.

3
  • \usepackage{unicode-math} should go after all other math packages, as recommended in it's documentation. Apr 10, 2016 at 16:26
  • 2
    It is not a problem specific to miktex. I see it with texlive 15 too. The problem is that when mathtools is detected unicode-math issues a \newfam \g__um_empty_fam and disturbs the family detection, but I can't look deeper now. Apr 10, 2016 at 16:49
  • imho it is a bug github.com/wspr/unicode-math/issues/345 Apr 10, 2016 at 21:34

2 Answers 2

1

This problem arose again here: Incompatibility with mathtools and unicode-math in xelatex?, and a patch is to be found in my answer.

A pull request has been made on the unicode-math developer site, to fix the issue which had been reported there by @UlrikeFischer.

0

It does not happen with:

\documentclass{article}
\usepackage{mathtools}
\DeclareSymbolFont{somemeaninglessname}{\encodingdefault}{\familydefault}{m}{it}
\usepackage{unicode-math}
[...]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .