![使用“setspace”包时方程环境后的间距错误](https://linux22.com/image/453377/%E4%BD%BF%E7%94%A8%E2%80%9Csetspace%E2%80%9D%E5%8C%85%E6%97%B6%E6%96%B9%E7%A8%8B%E7%8E%AF%E5%A2%83%E5%90%8E%E7%9A%84%E9%97%B4%E8%B7%9D%E9%94%99%E8%AF%AF.png)
答案1
您几乎肯定希望设置为显示跳过\lineskip
,并且需要延迟设置直到setspace
设置之后。
\documentclass{article}
\usepackage{amsmath}
\usepackage[onehalfspacing]{setspace}
\usepackage{lipsum}
% No!!!\setlength{\lineskip}{2em}
\AtBeginDocument{
\setlength{\abovedisplayskip}{2em plus .2em minus .2em}
\setlength{\abovedisplayshortskip}{1em plus .2em minus .2em}
\setlength{\belowdisplayskip}{2em plus .2em minus .2em}
\setlength{\belowdisplayshortskip}{1.5em plus .2em minus .2em}
}
\begin{document}
\lipsum[2]
\begin{equation*}
a + b + \frac{1}{2}
\end{equation*}
\lipsum[2]
\end{document}
\lineskip
与方程式没有直接关系,并且设置它会使稍微过大的线突然产生巨大的空间,请参见下面的示例。
\documentclass{article}
\begin{document}
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
One {\large \^X}xxx
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
\bigskip\hrule\bigskip
\setlength\lineskip{2em}
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
One {\large \^X}xxx
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
One two three four five six seven eight.
\end{document}