43

This is my code.

\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}

And it shows as this picture enter image description here

Everyone know how to fix it? Please help.

4
  • It is the default space. Maybe it is too big because you don't have material enough on the page to fill. Insert a lot of text (using \lipsum[1] from the lipsum package, for example) and see if the vertical space is smaller.
    – Sigur
    Commented Jan 26, 2015 at 11:36
  • 1
    Also, don't use double dollar. Use \[ \] instead.
    – Sigur
    Commented Jan 26, 2015 at 11:37
  • @sigur It does not different.
    – Mr.Lilly
    Commented Jan 26, 2015 at 11:40
  • So, don't worry. Just let TeX decide to you. When you finish your document you can try some adjustment.
    – Sigur
    Commented Jan 26, 2015 at 11:45

1 Answer 1

58

The spacing above equations is determined by the length \abovedisplayskip while the spacing below them is determined by the length \belowdisplayskip, so, modify them to achieve what you want, for example,

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

MWE

\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} 

enter image description here

7
  • 8
    You may also want to mention the parameters \abovedisplayshortskip and \belowdisplayshortskip, which come into play if the last line immediately before an equation is, well, short.
    – Mico
    Commented Jan 26, 2015 at 17:01
  • @Mico Thanks for the comment. But that's already in the duplicate link... Commented Jan 26, 2015 at 20:04
  • with answers like this one, I always wonder how the author even found out that X determines the length before/after Y, in this case X=\abovedisplayskip, Y=equation
    – axolotl
    Commented Aug 4, 2021 at 14:10
  • Thank you so much!
    – ALRADDADI
    Commented Nov 13, 2021 at 2:50
  • 2
    Has no effect, but I'm using the LNCS style template from Springer. Commented Mar 9, 2023 at 18:43

Not the answer you're looking for? Browse other questions tagged .