Altura incorreta para raiz quadrada usando unicode-math e lualatex

Altura incorreta para raiz quadrada usando unicode-math e lualatex

Isso é o que estou vendo:insira a descrição da imagem aqui Observe a discrepância na altura do símbolo da raiz quadrada em \sqrt{11}. Isso parece acontecer apenas quando eu compilo com lualatex.

Aqui está meu 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}

Presumo que seja um bug, mas não tenho certeza se é esse o caso ou como relatá-lo, se for.

Responder1

É um “recurso” conhecido da rangeopção. Você o cura restabelecendo como última fonte matemática a principal, escolhendo-a para o intervalo de algum símbolo.

O autor de unicode-mathestá ciente disso.

\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}

insira a descrição da imagem aqui

Responder2

Não há problema apenas com a altura das raízes, se você olhar com atenção verá que as regras horizontais das raízes estão erradas e também a regra da fração é muito fina. Como egreg escreveu, é um problema com a opção range. A última fonte matemática define constantes matemáticas importantes. Neste caso o problema está em \Umathradicalrulee \Umathfractionrulecomo você pode ver neste exemplo:

\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}

(Definir os valores como este um por um naturalmente não é o caminho a seguir, a solução de egreg é melhor, mas é muito interessante ver como esse valor afeta a saída.)

informação relacionada