# How can I prevent wide equation having too large vertical space?

I have a list of equations of which one is probably slightly larger than a certain threshold. This somehow results in the equation being given more vertical space above it than the others.

What can I do to make this equation behave like all the others in terms of vertical space above?

I am using XeTeX, Version 3.1415926-2.5-0.9999.3 (MiKTeX 2.9 64-bit) (preloaded format=xelatex 2015.4.29).

Minimal working example follows.

\documentclass[12pt,a4paper]{article}

\usepackage{fullpage}

\begin{document}

$$\sum_{e \in \mathcal{E}}\sum_{f \in \mathcal{F}} k_{ef} + \sum_{d \in \mathcal{D}} x_{abcd} + T_{abc} \leq 1 \quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}$$

$$w_{abc} \leq \sum_{g \in \mathcal{G}} g_{abcg} \quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}$$

$$X_{abcd} - \Delta^{+}_{abcd} + \Delta^{-}_{abcd} - x_{abcd} = 0 \quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}, d \in \mathcal{D}$$

$$Y_{abcdef} - \Delta^{-}_{abcdef} + \Delta^{+}_{abcdef} - y_{abcdef} = 0 \quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}, d \in \mathcal{D}, e \in \mathcal{E}, f \in \mathcal{F}$$

\end{document}


This results in the following output. Note the excessive vertical space between (3) and (4).

• Don't leave empty lines in between the equation environments. Then there is no odd spacing.
– user11232
Sep 24, 2015 at 15:01
• @HarishKumar That is a great help indeed. However, I now have a different spacing issue because there are some subequations environments in my list which exhibit the same spacing problem when removing the empty lines. Sep 24, 2015 at 15:09
• You should use a gather environment! Sep 24, 2015 at 15:10

I suggest you use a single gather environment (provided by the amsmath package) instead of four separate equation environments. To keep the distance between equations 3 and 4 roughly equal to that between equations 2 and 3, you could insert a \vphantom ("vertical phantom") in the third equation, as is shown in the code below.

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath} % for "gather" environment
\usepackage{fullpage} %für inch Abstände??

\begin{document}

\begin{gather}
\sum_{e \in \mathcal{E}}\sum_{f \in \mathcal{F}} k_{ef}
+ \sum_{d \in \mathcal{D}} x_{abcd} + T_{abc} \leq 1
\quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}\\
w_{abc} \leq \sum_{g \in \mathcal{G}} g_{abcg}
\quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}\\
X_{abcd} - \Delta^{+}_{abcd} + \Delta^{-}_{abcd} - x_{abcd} = 0
\quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C},
d \in \mathcal{D} \vphantom{\sum_{g \in \mathcal{G}}}\\ % <-- note the "\vphantom"
Y_{abcdef} - \Delta^{-}_{abcdef} + \Delta^{+}_{abcdef} - y_{abcdef} = 0
\quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C},
d \in \mathcal{D}, e \in \mathcal{E}, f \in \mathcal{F}
\end{gather}

\end{document}

• The problem with this approach is that my actual list of equations is quite long and should span several pages. Unfortunately, the gather environment doesn't break when it should, it is always displayed on one page. Sep 24, 2015 at 15:19
• Never mind, I found the option to allow page breaks within a gather environment. Thanks! Sep 24, 2015 at 15:22
• @Chris - Just for future readers of this posting: The instruction that allows page breaks within a gather environment is called \allowdisplaybreaks.
– Mico
Sep 24, 2015 at 15:32

Why don't you use the gather environment, from amsmath?

\documentclass[12pt,a4paper]{article}

\usepackage{fullpage}
\usepackage{amsmath}

\begin{document}

\begin{gather}
\sum_{e \in \mathcal{E}}\sum_{f \in \mathcal{F}} k_{ef} + \sum_{d \in \mathcal{D}} x_{abcd} + T_{abc} \leq 1 \quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}\\
w_{abc} \leq \sum_{g \in \mathcal{G}} g_{abcg} \quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}\\
X_{abcd} - \Delta^{+}_{abcd} + \Delta^{-}_{abcd} - x_{abcd} = 0 \quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}, d \in \mathcal{D}\\[1.5ex]
Y_{abcdef} - \Delta^{-}_{abcdef} + \Delta^{+}_{abcdef} - y_{abcdef} = 0 \quad \forall a \in \mathcal{A}, b \in \mathcal{B}, c \in \mathcal{C}, d \in \mathcal{D}, e \in \mathcal{E}, f \in \mathcal{F}
\end{gather}

\end{document}