Palatino 上划线上方有大量令人不快的空白

Palatino 上划线上方有大量令人不快的空白

我正在使用 XeLaTeX 和 Palatino/Pagella。使用该overline命令时,字母上方的空白量大到足以偏移整行,我觉得这很不愉快,因为其他字体似乎不会出现这种情况(或者至少不那么明显)。以下是一个例子:

\documentclass[10pt, a4paper]{article}


\usepackage{amsmath}

\usepackage{gensymb}

\usepackage{enumitem}


%load LaTeX text components before math math
\usepackage[T1]{fontenc}
\renewcommand{\rmdefault}{zpltlf}% Roman font for use in math mode
\usepackage[scaled=.85]{beramono}% used only by \mathtt
\usepackage[type1]{cabin}% used only by \mathsf
\usepackage{amsthm}% load before newtxmath
\usepackage[bigdelims, varbb]{newpxmath}
\usepackage[scr=boondox, frak=boondox]{mathalpha}
\usepackage{bm}% load after all math to give access to bold math%Now load the otf text fonts using fontspec---won't affect math
\usepackage[no-math]{fontspec} % process with XeLaTeX or LuaLaTeX
\setmainfont{TeXGyrePagellaX} % this reads in TeXGyrePagellaX.fontspec

\begin{document}
Let $f : X \rightarrow Y$ be a function between two topological spaces $X, Y$. Show that $f$ is continuous if and only if for every set $A \subset X$, $f(\overline{A}) \subset \overline{f(A)}$, where $\overline{A}$ denotes the closure of $A$.
\end{document}

生产

帕拉蒂诺

而仅仅使用 Computer Modern 就可以 现代的

Computer Modern 的间距变化不太明显。有没有解决办法(除了使用其他字体)?

答案1

冒着干扰相邻线条的风险,您可以自动粉碎它,就像我下面做的那样。不过,更安全的做法是给它一个不同的名字,只在需要时使用,例如\soverline(smashed-overline),就像 一样\newcommand\soverline[1]{\smash{\overline{#1}}}

沃纳在评论中正确地指出,如果不小心,就有可能被烧伤。

\documentclass[10pt, a4paper]{article}


\usepackage{amsmath}

\usepackage{gensymb}

\usepackage{enumitem}


%load LaTeX text components before math math
\usepackage[T1]{fontenc}
\renewcommand{\rmdefault}{zpltlf}% Roman font for use in math mode
\usepackage[scaled=.85]{beramono}% used only by \mathtt
\usepackage[type1]{cabin}% used only by \mathsf
\usepackage{amsthm}% load before newtxmath
\usepackage[bigdelims, varbb]{newpxmath}
\usepackage[scr=boondox, frak=boondox]{mathalpha}
\usepackage{bm}% load after all math to give access to bold math%Now load the otf text fonts using fontspec---won't affect math
\usepackage[no-math]{fontspec} % process with XeLaTeX or LuaLaTeX
\setmainfont{TeXGyrePagellaX} % this reads in TeXGyrePagellaX.fontspec
\let\svoverline\overline
\renewcommand\overline[1]{\smash{\svoverline{#1}}}
\begin{document}
Let $f : X \rightarrow Y$ be a function between two topological spaces $X, Y$. Show that $f$ is continuous if and only if for every set $A \subset X$, $f(\overline{A}) \subset \overline{f(A)}$, where $\overline{A}$ denotes the closure of $A$.
\end{document}

在此处输入图片描述

答案2

我建议不要破坏公式,而是增加基线跳跃,这通常对 Palatino 有益。

也许两种方法混合使用会更好。请注意,在第三个示例中,排版非常紧密,并且根据墨菲定律,上划线将与上划线发生冲突。

\documentclass[10pt, a4paper]{article}
\usepackage{amsmath}
%\usepackage{gensymb}
\usepackage{enumitem}

%load LaTeX text components before math math
\usepackage[scaled=.85]{beramono}% used only by \mathtt
\usepackage[type1]{cabin}% used only by \mathsf
\usepackage{amsthm}
\usepackage[bigdelims, varbb]{newpxmath}
\usepackage[scr=boondox, frak=boondox]{mathalpha}
\usepackage{bm}
\usepackage[no-math]{fontspec}
\setmainfont{TeXGyrePagellaX}

\linespread{1.2}

\setlength{\lineskip}{20pt} % just to check that it doesn't enter the scene

\begin{document}

\textbf{This uses larger baseline skip}

Let $f\colon X \rightarrow Y$ be a function between two 
topological spaces $X, Y$. Show that $f$ is continuous 
if and only if for every set $A \subset X$, 
$f(\overline{A}) \subset \overline{f(A)}$, where 
$\overline{A}$ denotes the closure of $A$.

\bigskip

\linespread{1.1}\selectfont

\textbf{This uses not so large baseline skip and smashed formulas}

Let $f\colon X \rightarrow Y$ be a function between two 
topological spaces $X, Y$. Show that $f$ is continuous 
if and only if for every set $A \subset X$, 
\smash{$f(\overline{A}) \subset \overline{f(A)}$}, where 
\smash{$\overline{A}$} denotes the closure of $A$.

\bigskip

\linespread{1}\selectfont

\textbf{This uses smashed formulas}

Let $f\colon X \rightarrow Y$ be a function between two 
topological spaces $X, Y$. Show that $f$ is continuous 
if and only if for every set $A \subset X$, 
\smash{$f(\overline{A}) \subset \overline{f(A)}$}, where 
\smash{$\overline{A}$} denotes the closure of $A$.

\end{document}

在此处输入图片描述

相关内容