如何减少显示方程式上方和下方的空间

如何减少显示方程式上方和下方的空间

这是我的代码。

\documentclass{article}
\usepackage{amssymb,amsmath,amsthm,enumitem}

\begin{document}
How can I decrease vertical space between text above and below \$\$ \ldots \$\$ ?
$$x^{2}+y^{2} = 1$$
How can I decrease vertical space between text above and below \$\$ \ldots \$\$ ?

And how can I decrease vertical space between text above and below align command ?
\begin{align*}
abdefg &= 1\\
     &\leq 2.
\end{align*}
How can I decrease vertical space between text above and below align command ?
\end{document}

如下图所示 在此处输入图片描述

大家都知道该怎么修复吗?请帮忙。

答案1

方程式上方的间距由长度决定,\abovedisplayskip而方程式下方的间距由长度决定\belowdisplayskip,因此,修改它们以实现您想要的,例如,

\setlength{\abovedisplayskip}{3pt}
\setlength{\belowdisplayskip}{3pt}

平均能量损失

\documentclass{article}
\usepackage{amssymb,amsmath,amsthm,enumitem}

\begin{document}

\setlength{\abovedisplayskip}{3pt}
\setlength{\belowdisplayskip}{3pt}

How can I decrease vertical space between text above and below \$\$ \ldots \$\$?
\[x^{2}+y^{2} = 1\]
How can I decrease vertical space between text above and below \$\$ \ldots \$\$?

And how can I decrease vertical space between text above and below align command?
\begin{align*}
abdefg &= 1\\
     &\leq 2.
\end{align*}
How can I decrease vertical space between text above and below align command?
\end{document} 

在此处输入图片描述

相关内容