# Defining new split environment with reduced spacing

this is my first stackexchange question so apologies for any bad etiquette.

I'm writing a document in double spacing. I don't wants the gaps between the lines of a multi-line equation to be that large, though.

I know that I can make this change globally by using

\setlength{\jot}{<size>}


...but this also affects other spacings that I don't want to change, e.g. in an xymatrix or when using \gather

I also know that I can keep the changes local by using

\begingroup\setlength{\jot}{<size>}\begin{split}
...
\end{split}\endgroup


...but there is a very large number of split equations in my document and I'd prefer not to make it even messier by doing this.

I tried to define a new environment to effect this local change, like so

\newenvironment{Split}%
{\begingroup\setlength{\jot}{-3pt}\begin{split}}%
{\end{split}\endgroup}


But when I try to implement this in the document I get the following error message:

LaTeX Error: \begin{split} on input line xxx ended by \end{Split}.

I've had success in defining new environments before so I don't know what I'm doing wrong this time.

MWE:

\documentclass{article}

\usepackage{setspace}
\doublespacing

\usepackage{amsmath}

\newenvironment{Split}%
{\begingroup\setlength{\jot}{-3pt}\begin{split}}%
{\end{split}\endgroup}

\begin{document}

$$\begin{split} y&=x+x\\ &=2x \end{split}$$

$$\begin{Split} y&=x+x\\ &=2x \end{Split}$$

\end{document}

-
Welcome to TeX.SX! – Jubobs Sep 3 '14 at 11:36
You don't need the \begingroup and \endgroup as they are provided by \newenvironment. In addition, if you replace \begin{split} with \split and \end{split} with \endsplit then your code at least compiles, but the spacing is unaffected. I'm not sure why the spacing is unaffected and I don't have time to investigate now. – Andrew Sep 3 '14 at 11:56
See texdoc technote section 6... – Andrew Swann Sep 3 '14 at 12:11
You may simply state \setlength{\jot}{-3pt} in the preamble: the length is used in all alignment environments. – egreg Sep 3 '14 at 12:21
@egreg I explained why I don't want to do that. – mattghg Sep 3 '14 at 12:56

\documentclass{article}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{etoolbox}

\usepackage{lipsum} % just for the example
\usepackage[vmargin=2cm]{geometry} % just for the example

\doublespacing

\begin{document}

\lipsum*[2]
$$\begin{split} y&=x+x\\ &=2x \end{split}$$
\lipsum*[2]
\begin{align}
y&=x+x\\
&=2x
\end{align}
\lipsum*[2]
\begin{gather}
y=x+x\\
z=2x
\end{gather}
\lipsum*[2]

\end{document}


-

You can modify the \gather@split macro, calling \linespread{1}\selectfont before \spread@equation.

This won't affect other alignment environments.

\documentclass{article}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{etoolbox}

\usepackage{lipsum} % just for the example
\usepackage[vmargin=2cm]{geometry} % just for the example

\doublespacing

\makeatletter
\patchcmd{\gather@split}
{}{}
\makeatother

\begin{document}

\lipsum*[2]
$$\begin{split} y&=x+x\\ &=2x \end{split}$$
\lipsum*[2]
\begin{align}
y&=x+x\\
&=2x
\end{align}
\lipsum*[2]
\begin{gather}
y=x+x\\
z=2x
\end{gather}
\lipsum*[2]

\end{document}


-