Math & ScienceSuppressing Extra Vertical Space Around Display Math

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
jun0
Posts: 5
Joined: Sat Oct 17, 2009 9:36 am

Suppressing Extra Vertical Space Around Display Math

Post by jun0 »

Display math environments like \[..\], align (of AMS-LaTeX), etc. insert extra vertical space of about 0.5\baselineskip above and below the formula, which makes the text look very sparse with double spacing. Is there a way to suppress or shrink this extra space? I want align* to work especially, but tricks that work for other environments are also useful. Adding \vspace{-0.5\baselineskip} does work, but that seems too ad-hoc and cumbersome....
Any help is appreciated.

MWE:
  • \documentclass[12pt]{article}
    \usepackage{fullpage}
    \usepackage{setspace}
    \usepackage{amsmath}
    \begin{document}

    \doublespacing
    Preceding line. Preceding line. Preceding line. Preceding line.
    Preceding line. Preceding line. Preceding line. Preceding line.
    Preceding line. Preceding line. Preceding line. Preceding line.
    Preceding line. Preceding line. Preceding line. Preceding line.
    \begin{align*}
    math %% This text has too much vertical space around it.
    \end{align*}
    Trailing line. Trailing line. Trailing line. Trailing line.
    Trailing line. Trailing line. Trailing line. Trailing line.
    Trailing line. Trailing line. Trailing line. Trailing line.
    Trailing line. Trailing line. Trailing line. Trailing line.

    \end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Suppressing Extra Vertical Space Around Display Math

Post by localghost »

Please tag source code as such by using the code environment of the forum (see Board Rules). This helps to keep a post clear and legible.

Take a look at Section 43 (Length registers, p. 72ff) of the »Math mode« document.


Best regards and welcome to the board
Thorsten
jun0
Posts: 5
Joined: Sat Oct 17, 2009 9:36 am

Suppressing Extra Vertical Space Around Display Math

Post by jun0 »

Thanks Thorsten, that's just what I was looking for!
Sorry about the markup. I'll be careful next time.

PS. I'll make note of a caveat that got me confused for a while; it may be useful to someone else who finds this post having the same problem: changes to \abovedisplayskip and friends don't seem to affect amsmath environments (align etc) if a change to line spacing happens in between. So AFAICT, this works:

Code: Select all

\doublespacing

\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\abovedisplayskip=0pt
\belowdisplayskip=0pt
\begin{align*}
  ...
\end{align*}
but this doesn't:

Code: Select all

\abovedisplayshortskip=0pt
\belowdisplayshortskip=0pt
\abovedisplayskip=0pt
\belowdisplayskip=0pt

\doublespacing

\begin{align*}
  ...
\end{align*}
Confusingly enough, both seems to work if you're using equation instead of align*.
Post Reply