# Vertical space using default display skip

I have defined the following environment that tightens up equations of different environments, adding just one initial and one final space. For example, this code:

\documentclass{article}

\newenvironment{tight}
{
\vspace{\abovedisplayskip}
\setlength{\abovedisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
}{
\vspace{10.0pt plus 2.0pt minus 5.0pt}
}

\setlength{\parindent}{4em}

\begin{document}

Sample text Sample text Sample text Sample text Sample text Sample text Sample text Sample text Sample text:
\begin{tight}
$$a = b^ 2 + c^2$$
$$e^{j\theta} = \cos \theta + j \sin \theta$$
\end{tight}
Sample text Sample text Sample text Sample text Sample text Sample text Sample text Sample text Sample text.

\end{document}


Gives this result:

There are two problems with the environment:

• As you can see from the example, the last \vspace is not placing the space as intended (unless I make a new paragraph, but I do not want that).
• I must manually define the parameters of the last \vspace, I do not know a way of saving the default skip parameters before setting them to zero.

My question is: is there a way fixing any of these problems?

You are trying to reinvent the wheel! 😉

Doing that with \vspace is not really the best choice and moreover the spacing you get will be very uneven.

The problem is solved by using gather:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Sample text Sample text Sample text Sample text Sample text
Sample text Sample text Sample text Sample text:
\begin{gather}
a = b^ 2 + c^2
\\
e^{j\theta} = \cos \theta + j \sin \theta
\end{gather}
Sample text Sample text Sample text Sample text Sample text
Sample text Sample text Sample text Sample text.

\end{document}


It is possible with a tight environment, but I can't recommend doing it.

\documentclass{article}
\usepackage{amsmath}

\newenvironment{tight}
{%
\vspace{\abovedisplayskip}%
\setlength{\savedbelowdisplayskip}{\belowdisplayskip}% save the value
\setlength{\abovedisplayskip}{0pt}%
\setlength{\abovedisplayshortskip}{0pt}%
\setlength{\belowdisplayskip}{0pt}%
\setlength{\belowdisplayshortskip}{0pt}%
}{%
\ignorespacesafterend
}
\newlength{\savedbelowdisplayskip}

\begin{document}

Sample text Sample text Sample text Sample text Sample text
Sample text Sample text Sample text Sample text:
\begin{tight}
$$a = b^ 2 + c^2$$
$$e^{j\theta} = \cos \theta + j \sin \theta$$
\end{tight}
Sample text Sample text Sample text Sample text Sample text
Sample text Sample text Sample text Sample text.

\end{document}


You can get tighter spacing also with gather by setting \jot to zero, but I don't recommend it either.

\documentclass{article}
\usepackage{amsmath}

\setlength{\jot}{0pt}

\begin{document}

Sample text Sample text Sample text Sample text Sample text
Sample text Sample text Sample text Sample text:
\begin{gather}
a = b^ 2 + c^2
\\
e^{j\theta} = \cos \theta + j \sin \theta
\end{gather}
Sample text Sample text Sample text Sample text Sample text
Sample text Sample text Sample text Sample text.

\end{document}


• I cannot use gather, I have cases where I have to use multline followed by align, but your environment does the trick. Thank you! – Daniel Turizo Sep 13 '18 at 2:06