When I have a displayed math equation (\[...\] or equivalently the displaymath environment) at the start of a paragraph right after a heading, there is too much space before it.

This short code reproduces the problem.

\section{Quadratic formula}
%Line line line line line line line line line.
\[x = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\]
Line line line line line line line line line.

If the commented line is uncommented, the space around the equation becomes acceptable:

Illustration of problem

The problem does not seem to be caused by geometry. Repeating the above without geometry loaded produces this:

Illustration of problem without geometry

Using $$...$$ instead (which seems to be discouraged in LaTeX) does not produce this problem:


The problem seems to be caused by the definition of \[ — specifically the italicised line:

      $$%%$$ BRACE MATCH HACK

What should I do? Do I just use $$...$$? Or is there a better solution?

  • 1
    Please give a use case for a displayed equation immediately follow a sectioning header.
    – Mico
    Commented May 2, 2015 at 14:09
  • @Mico The MWE I gave is more or less the same as my actual document (except that it deals with a different equation). But does it matter? If you intend to suggest that I arrange my document differently, that isn't a solution to the problem.
    – angelsl
    Commented May 2, 2015 at 14:15
  • I bet this is for some kind of equation collection/cheat-sheet right? You wouldn't write an equation after a heading in a thesis or paper, right?
    – Johannes_B
    Commented May 2, 2015 at 14:16
  • @Johannes_B Yeah, it's for my own notes on a subject. Not a formal paper.
    – angelsl
    Commented May 2, 2015 at 14:16
  • 1
    That doesn't answer the question why there is additional space, but ... The section command does some stuff you might not be aware of, generating a toc-entry, stepping counters, placing the title, adding space ... If this is for some personal notes, you can redefine section for your own needs.Of course, you are loosing some funcionality. btw, very good example and welcome to TeX.SX. :-)
    – Johannes_B
    Commented May 2, 2015 at 14:23

1 Answer 1


amsmath redefines \[...\] to its own equation* environment which doesn't use \makebox to workaround vmode spacing issues.

So loading amsmath solves this problem.

  • The ` amsmath` definitions ans $$ all produce bad spacing if used at the start of the paragraph, although in this case after a heading the amsmath version makes a reasonable result. Commented May 2, 2015 at 15:48

You must log in to answer this question.

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