# Uneven vertical spacing displaymath

I would like to ask you why we have uneven vertical skips between the first two and last two vectors, coming from the source:

\documentclass{article}
\begin{document}
$(a,b,c,d,e,f,g,h)$
$(a,b,c,d,e,f,g,h)$
$(a,b,c,d,e,f,g,h)$
\end{document}


If I use more than 3 consecutive displaymath lines the same phenomenon happens: the vertical skip between the first two is considerably larger than the space between any further two lines. Any workarounds? I am using MikTex 2.9 with TeXnicCenter.

• Loading the amsmath package gives you even vertical spacing. However, consecutive displays should be avoided. A gather environment (from amsmath) could be used instead. – Gonzalo Medina Sep 19 '11 at 19:52

Never use consecutive math environments. The correct output can be obtained by

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
(a,b,c,d,e,f,g,h)\\
(a,b,c,d,e,f,g,h)\\
(a,b,c,d,e,f,g,h)
\end{gather*}
\end{document}


The amsmath package has a bunch of environments for proper math typesetting, consult its documentation; you should have on your system the file amsldoc.pdf that contains it.

• Note that consecutive display math environments would allow a pagebreak between them. With gather*, a page break is normally disallowed, but the workaround is to replace each \\ with \displaybreak[0]\\ or something like that. – ShreevatsaR Apr 16 '18 at 9:13
• @ShreevatsaR Yes, that's explained in the manual for amsmath. In my opinion, allowing arbitrary page breaks between displayed equations is bad and judgment should be used. – egreg Apr 16 '18 at 9:16

Whenever you have two or more consecutive lines of displaymath, you should seriously consider using the equation-grouping environments of the amsmath package. The basic equation-grouping environments of this package are gather, best if each line is a separate entity not particularly related to those that come before or after, and align, designed to let you align consecutive equations on some location, frequently (but not necessarily) an equal-sign. A line break between equations is created by the \\ command. There are both numbered and unnumbered versions of these environments -- the latter are created by appending an asterisk to the environment name, e.g., gather* and align*. The following modified form of your MWE has consistent (and tight) spacing between the equations.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
(a,b,c,d,e,f,g,h)\\
(a,b,c,d,e,f,g,h)\\
(a,b,c,d,e,f,g,h)
\end{gather*}
\end{document}


The amsmath package provides additional equation-grouping environments besides the two I've just mentioned, as well as many other commands that are very useful if you need to typeset math-related stuff. Its main user guide is the file amsldoc.pdf.

Before the first equation should be some "text", eg:

\documentclass{article}
\begin{document}
\mbox{}
$(a,b,c,d,e,f,g,h)$
%
$(a,b,c,d,e,f,g,h)$
%
$(a,b,c,d,e,f,g,h)$

\end{document}