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}
\begin{equation}
a = b^ 2 + c^2
\end{equation}
\begin{equation}
e^{j\theta} = \cos \theta + j \sin \theta
\end{equation}
\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?