I’m having trouble with XeLaTeX (0.9998) and unicode-math
(0.7a). If I use \setmathfont
more than twice, the \sqrt
command breaks when a superscript is specified.
\documentclass{minmal}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\setmathfont[range=\mathup/{num,latin,Latin}]{Linux Libertine O}
\setmathfont[range=\mathup/{greek,Greek}]{Symbola}
\begin{document}
\[ \sqrt[5]{2} \]
\end{document}
If I typeset this code, XeLaTeX will produce the following error
Font \l_tmpb_font has only 8 fontdimen parameters.
If I remove the superscript from \sqrt
or remove the last \setmathfont
command, the document compiles correctly. I’ve tested this code with several OTF files, and they all produced the same result. (I know the resulting superscript is improperly positioned, but I can work on this once I know the document can be typeset.)
I filed a bug for this issue on GitHub because I believe it’s a problem with the package, but I should have checked here before doing so, and I will gladly close the bug if I find I was doing something stupid.
Best Answer
Tracing through the code, the issue is that
unicode-math
redefines\r@@t
, which is used by LaTeX when it typesets a root with an index. The redefinition is different for LuaTeX and XeTeX, so you only see the issue with XeTeX. In that case, it isThe key here is the
\fontdimen
business: these are 'high number' font dimensions which are not available in traditional TeX. As such, these are not defined for text fonts: they are only available for 'proper' Unicode math fonts. You therefore see the error only if you set up some symbols to be taken from a text font.