If a document (in any class) is double spaced, how do you redefine the spacing around centered equations as if there was single spacing? Whenever I use double spacing, I feel like the space before and after a centered equations is too large.

3 Answers 3


If you are using the setspace package to change to doublespacing, you could use the etoolbox package and its \BeforeBeginEnvironment and \AfterEndEnvironment to append \begin{singlespace} before, and \end{singlespace} after the environments for displayed equations. The following example illustrates this approach for the equation and align environments (similar declarations will have to be made for the other environments and for their starred versions):

\usepackage{lipsum}% just to generate text for the example





  • What does \lipsum[2] mean?
    – richtera
    Commented Mar 29, 2012 at 1:07
  • 1
    @AlexRichter The lipsum package generates filler text; lipsum[2] means "use the second paragraph of the predefined text"; more generally, \lipsum[i-j] (with i<j) means "use the paragraphs i to j of the predefined text". Commented Mar 29, 2012 at 1:11
  • 4
    @AlexRichter: Mico's answer is better and you should accept it instead of mine. Commented Mar 29, 2012 at 2:47
  • It seems Mico's answer is not the same as this answer. Using nodisplayskipstretch does not make align environments singlespaced. However, this answer definitely does.
    – Umang
    Commented Jan 5, 2014 at 3:58
  • @Umang - I only now noticed your comment, which you posted nearly 5 years ago. Your application, which appears to involve align environments, is fundamentally different from what the OP posted and the answers provided by both Gonzalo Medina and myself, which treated single-line equations.
    – Mico
    Commented Nov 16, 2018 at 7:45

You could simply set the nodisplayskipstretch option of the setspace package, viz., write


in the preamble. An advantage of this solution is that it applies automatically to all display-math environments. (Aside: In the MWE below, the \namdui command serves to produce some filler text -- specifically, the first few sentences of the second stanza of the lipsum package's text.)


\newcommand{\namdui}{Nam dui ligula, fringilla a, euismod sodales, 
sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, 
pretium at, lobortis vitae, ultricies et, tellus.}  % filler text



enter image description here


A potentially better alternative to setspace with nodisplayskipstretch or etoolbox is instead to use setspace as follows:


This usually results in a more compact document. For example, the following code produces a document with 77 pages:

\documentclass[a4paper]{article}  %  For a consistent page count, specify a paper size.
\usepackage{blindtext}  %  Introduces the "Lorem ipsum..." filler text command \blindtext
\usepackage{pgffor}     %  Introduces the \foreach command

  \foreach \n in {1,...,200}{  % repeat 200 times
    \blindtext  % "Lorem ipusm..." filler text

In comparison, the page counts corresponding to the various possible setspace commands are:

║ Page count ║ setspace command                                   ║
║         77 ║ \usepackage{setspace}\setdisplayskipstretch{}      ║
║         80 ║ Gonzalo Medina's answer using etoolbox             ║
║         81 ║ \usepackage[nodisplayskipstretch]{setspace}        ║
║         86 ║ \usepackage{setspace}                              ║
║         93 ║ \renewcommand{\baselinestretch}{2} % (no setspace) ║


I will contrast \usepackage{setspace}\setdisplayskipstretch{} with \usepackage[nodisplayskipstretch]{setspace}. Looking into setspace.sty, we see the following relevant lines:

  \abovedisplayskip \displayskipstretch\abovedisplayskip
  \belowdisplayskip \displayskipstretch\belowdisplayskip
  \abovedisplayshortskip \displayskipstretch\abovedisplayshortskip
  \belowdisplayshortskip \displayskipstretch\belowdisplayshortskip

Therefore, the option nodisplayskipstretch is equivalent to setting the factor \displayskipstretch=1.0. One may expect that multiplying by 1 should do nothing, but of course TeX is not that simple. ;) The displayskip commands are <glue> types, which means they contain a ± range called "stretch and shrink." Multiplying by 1 removes the stretch and shrink, because it converts <glue> to <dimen>. Thus setspace normally clobbers TeX's built-in flexibility to shrink the gaps above and below equations. The \setdisplayskipstretch{} command prevents the multiplication, preserving the <glue> which allows the gaps to shrink. That's why the resulting page count is lower.

Many thanks to David Carlisle for explaining to me what was going on.

  • you are correct. \usepackage{setspace}\setdisplayskipstretch{} is best.
    – Nasser
    Commented Aug 21, 2023 at 4:21

You must log in to answer this question.

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