# Clone of the amsmath equation environment with different spacing

I would like to create a new environment which acts exactly the same as the equation environment from amsmath; however, I want this new environment to have less spacing above and below the environment. I do not want to overwrite or alter the extant equation environment. I want both environments.

How would I go about doing this? I've always been an end-user of packages, so creating something like this is outside my experience.

• equation is standard latex environment. – Zarko Jan 5 '18 at 23:18
• I’m curious: Why do you think it’s necessary to “clone” the math environments of the amsmath package — of which there are quite a few — in order to achieve your stated objective? (The amsmath package modifies the behavior of the equation environment.) Why not just change the values of the length parameters \abovedisplayskip and \belowdisplayskip? – Mico Jan 5 '18 at 23:19
• Using two different sets of spacing settings for displayed equations is pretty much an invitation to typographic hell (or, at the very least, purgatory). Why inflict it on your poor readers? – Mico Jan 5 '18 at 23:24
• that's what I suspected, but if that is the intention you can skip all the effort to set up a new counter and make the clone not be a clone but use the new counter, basically you just need a definition that resolves to \vspace{-2pt}$...$\vspace{-2pt} if you want 2pt less than a normal display math – David Carlisle Jan 5 '18 at 23:41
• You don't need to create a typographical hell or add inconsistencies to your document, why don't you add an MWE to your question to better understand your problem and what solution can be given? – Aradnix Jan 5 '18 at 23:53

Without going into the details for the independent numbering, you can set differently the parameters for the spacing.

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}

\newenvironment{equation-}
{%
\abovedisplayshortskip=0pt plus 1pt
\abovedisplayskip=2pt plus 1pt minus 1pt
\belowdisplayshortskip=\abovedisplayskip
\belowdisplayskip=\abovedisplayskip
$$% } {$$\ignorespacesafterend}

\begin{document}

\lipsum*[2]
\begin{equation-}$$1\quad 2\quad 3$$\end{equation-}
Short short short short short short short short short short short short
short short
\begin{equation-}$$1\quad 2\quad 3$$\end{equation-}
\lipsum*[2]
$$1\quad 2\quad 3$$
\lipsum[2]

\end{document}


I'm not sure you really want it.

For the independent numbering:

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}

\newcounter{savedequation}
\newcounter{shortequation}

\newenvironment{equation-}
{%
\setcounter{savedequation}{\value{equation}}%
\setcounter{equation}{\value{shortequation}}%
\renewcommand\theequation{S\arabic{equation}}%
\abovedisplayshortskip=0pt plus 1pt
\abovedisplayskip=2pt plus 1pt minus 1pt
\belowdisplayshortskip=\abovedisplayskip
\belowdisplayskip=\abovedisplayskip
$$% } {%$$%
\setcounter{shortequation}{\value{equation}}%
\setcounter{equation}{\value{savedequation}}%
\ignorespacesafterend
}

\begin{document}

\lipsum*[2]
$$a=b$$
\lipsum*[2]
\begin{equation-}
\end{equation-}
Short short short short short short short short short short short short
short short
\begin{equation-}
$$c=d$$