Incorrect height for square root using unicode-math and lualatex

This is what I'm seeing: Note the discrepancy in the height of the square root symbol in \sqrt{11}. This seems to happen only when I compile with lualatex.

Here's my MWE:

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmathfont[]{TeX Gyre Pagella Math}
\setmathfont[range={cal}]{Latin Modern Math}

\begin{document}
Note well:
\begin{equation*}
x = \sqrt{11}\sqrt{19}
y = \frac{\sqrt{11}\sqrt{19}}{26}
\end{equation*}
\end{document}


I assume this is a bug, but I'm not sure whether that's the case, or how to report it if it is.

• It looks like the problem goes away if I use xelatex, so that might also be a solution. – Derek Apr 11 '17 at 23:17
• This problem has been corrected for the next version of unicode-math. – Will Robertson Jan 3 '18 at 8:35

It's a known “feature” of the range option. You cure it by reestablishing as last math font the main one, choosing it for the range of some symbol.

The author of unicode-math is aware of it.

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmathfont[]{TeX Gyre Pagella Math}
\setmathfont[range={cal}]{Latin Modern Math}
\setmathfont[range=\int]{TeX Gyre Pagella Math}

\begin{document}
Note well:
\begin{equation*}
x = \sqrt{11}\sqrt{19}
y = \frac{\sqrt{11}\sqrt{19}}{26}
\end{equation*}
\end{document}


• This is a useful workaround for my case. Thanks. – Derek Apr 11 '17 at 23:17

There is not only a problem with the height of the roots, if you look carefully you can see that the horizontal rules of the roots are wrong and also the fraction rule is to thin. As egreg wrote it is a problem with the range option. The last math font sets important math constants. In this case the problem is with \Umathradicalrule and \Umathfractionrule as you can see in this example:

\documentclass{article}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmathfont[]{TeX Gyre Pagella Math}
\makeatletter\check@mathfonts \makeatother
\edef\displaystylefraction{\the\Umathfractionrule\displaystyle}

\setmathfont[range={cal}]{Latin Modern Math}

\begin{document}
\makeatletter\check@mathfonts \makeatother