使用 \sqrt 和 TeX Gyre Pagella Math 实现行高

使用 \sqrt 和 TeX Gyre Pagella Math 实现行高

使用 TeX Gyre Pagella Math 作为数学字体,我注意到在段落中unicode-math插入内联平方根会导致行太高,从而导致行与行之间出现非常难看的跳跃(见下图):$\sqrt{S}$

\documentclass[a4paper, 12pt]{scrartcl}

\usepackage{unicode-math}
\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}
\usepackage{lipsum}

\begin{document}
\lipsum*[1]
$\sqrt{S}$
\lipsum*[1]
$\smash{\sqrt{S}}$
\lipsum*[1]

\end{document}

行高问题说明

我认为这是由于 Pagella Math 字体的度量造成的,因为 Computer Modern 似乎不会出现这种情况(或者至少不那么明显)。如上所示,一种解决方法是将平方根包装在 中\smash

有没有更好的方法可以解决这个问题?我不确定我是否对这个\smash解决方法感到满意。此外,我必须记住将所有可能出现的问题包装\sqrt在 中\smash

答案1

使用标准 LaTeX 和 也能看到这种效果mathpazo

您可以通过扩大行距来“修复”这个问题,当文本字体是 Palatino 时我总会学会这么做。

\documentclass[a4paper, 12pt]{scrartcl}

\usepackage{unicode-math}
\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}
\setmathfont[range=\sqrt]{Asana Math} % better than the Pagella symbol

\linespread{1.1}

\usepackage{lipsum}

\begin{document}

\lipsum*[2]
$\sqrt{S}$
\lipsum*[2]
\smash{$\sqrt{S}$}
\lipsum[2]
\end{document}

在此处输入图片描述

如果我使用 Pagella 的标准平方根符号,该线将再次变得太高。

相关内容