4

This is what I'm seeing:enter image description here 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}
    \qquad
    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
  • 1
    This problem has been corrected for the next version of unicode-math. – Will Robertson Jan 3 '18 at 8:35
2

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}
    \qquad
    y = \frac{\sqrt{11}\sqrt{19}}{26}
  \end{equation*}
\end{document}

enter image description here

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

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\textstylerulewidth{\the\Umathradicalrule\textstyle}
\edef\displaystylerulewidth{\the\Umathradicalrule\displaystyle}
\edef\displaystylefraction{\the\Umathfractionrule\displaystyle}

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


\begin{document}
\makeatletter\check@mathfonts \makeatother
\Umathradicalrule\textstyle=\textstylerulewidth 
\Umathradicalrule\displaystyle=\textstylerulewidth 
\Umathfractionrule\displaystyle=\displaystylefraction
  Note well:
  \begin{equation*}
    x = \sqrt{11}\sqrt{19}
    \qquad
    y = \frac{\sqrt{11}\sqrt{19}}{26}
  \end{equation*}
\end{document}

(Setting the values like this one-by-one is naturally not the way to go, the solution of egreg is better, but it is imho interesting to see how this value affect the output.)

  • Thanks for this, Ulrike — I've used this approach in the next version of the code to save and restore the values. (I haven't decided how this should be unified with XeTeX and also made configurable, but it's a start...) – Will Robertson Jan 3 '18 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.