我对方程式周围的间距感到困惑。
也许我读错了,但我的理解如下\abovedisplayskip
,\abovedisplayshortskip
它将控制公式周围的垂直间距/粘连。当段落的最后一行与行下的公式重叠时,应该应用第一个。否则,将应用第二个。
在下面的 MWE 中,我预计第二个方程会向上移动,因为-X\baselineskip
该线与方程不重叠,但它不适用。
\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage[onehalfspacing]{setspace}
\newcommand\mathexpr{%
\begin{align*}f(x) = \sqrt{A^2 + B^2 + C^2} \end{align*}}
\setlength{\parindent}{0pt}
\AtBeginDocument{%
\setlength\abovedisplayskip{\baselineskip}
\setlength\abovedisplayshortskip{-10\baselineskip}}
\begin{document}
As any dedicated reader can clearly see, the Ideal of practical reason of things.
\mathexpr
As any dedicated reader can clearly see, the Ideal of practical reason is a representation.
\mathexpr
As any dedicated reader can clearly see, the Ideal of practical reason of things.
\end{document}
答案1
AMS 对齐始终是全宽的,因此从不使用短跳。
如果你尝试一下\[\]
,你会看到效果:
\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage[onehalfspacing]{setspace}
\newcommand\mathexpr{\[x=y\]}
\setlength{\parindent}{0pt}
\AtBeginDocument{%
\setlength\lineskiplimit{-100pt}
\setlength\abovedisplayskip{\baselineskip}
\setlength\abovedisplayshortskip{-10\baselineskip}}
\begin{document}
As any dedicated reader can clearly see, the Ideal of practical reason of things.
\mathexpr
As any dedicated reader can clearly see, the Ideal of practical reason is a representation.
\mathexpr
As any dedicated reader can clearly see, the Ideal of practical reason of things.
\end{document}