# Difference between (split, align) and (gather, aligned)?

Here is an MWE which shows that they seem to do the same thing. Is there any reason to prefer one over the other for typesetting groups of equations? I would prefer the align syntax because it allows intertext. In the other case, the alignment is limited to aligned environments within the larger gather environment. Any thoughts are welcome.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

%==================
% gather+aligned
\begin{gather}
\begin{aligned}
x &= a + b\\
y &= c+ d
\end{aligned}
\end{gather}

%==================
% align+split
\begin{align}
\begin{split}
x &= a + b\\
y &= c+ d
\end{split}
\end{align}

\end{document}

-
I gather (pun intended) that you're considering these two setups because they let you assign a single equation number to each equation pair. Note that the setup of both groups, as stated in the MWE, is currently overkill because you could actually replace all gather and align instances with equation and get the exact same outcome. To really get a chance to distinguish between the pros and cons of the two setups, you need to make their structures a bit richer. (Currently, there's really not enough there to distinguish between them.) Please consider editing your MWE accordingly. –  Mico Jul 19 '12 at 15:01
Actually, the 2nd example would work just fine without split, and as @Mico says, the 1st one can use simple equation instead of gather. –  yo' Jul 19 '12 at 16:22
@tohecz Without split both lines would be numbered. –  egreg Jul 19 '12 at 20:06
@AdorableCreature "recent changes" (To the AMS alignments??) –  David Carlisle Dec 30 '12 at 0:39
@DavidCarlisle: recent changes refer to my comment in egreg's answer. –  kiss my armpit Dec 30 '12 at 1:53

For the example alignment the following are equivalent; actually, the correct outer environment to use is equation, as the following code will show; using split or aligned for the inner environment in this case doesn't matter.

\documentclass{article}
\usepackage{amsmath,lipsum,geometry}
\geometry{margin=1cm}
\begin{document}
%\thispagestyle{empty}

\lipsum*[2]
%==================
% equation+aligned
\tag{EA} \begin{aligned} x &= a + b\\ y &= c+ d \end{aligned}
\lipsum*[2]
%==================
% equation+split
$$\tag{ES} \begin{split} x &= a + b\\ y &= c+ d \end{split}$$
\lipsum*[2]
%==================
% gather+aligned
\begin{gather}\tag{GA}
\begin{aligned}
x &= a + b\\
y &= c+ d
\end{aligned}
\end{gather}
\lipsum*[2]
%==================
% gather+split
\begin{gather}\tag{GS}
\begin{split}
x &= a + b\\
y &= c+ d
\end{split}
\end{gather}
\lipsum*[2]
%==================
% align+split
\begin{align}\tag{AS}
\begin{split}
x &= a + b\\
y &= c+ d
\end{split}
\end{align}
\lipsum*[2]
%==================
% align+aligned
\begin{align}\tag{AA}
\begin{aligned}
x &= a + b\\
y &= c+ d
\end{aligned}
\end{align}
\lipsum*[2]

\end{document}


In the output it's possible to see that the correct spacing is obtained with equation. Use align or gather only when there is really more than one equation to number.

One should also note that "equation+split" results in a different spacing than "equation+aligned" (which isn't really expected).

-
Are there some egregious (!) typos in your code? :-) –  fg nu Nov 4 '12 at 12:45
@fgnu Thanks, fixed –  egreg Nov 4 '12 at 13:15
Why didn't you give an example of "gather+split"? –  kiss my armpit Nov 4 '12 at 13:59
So far, this is my definite guide concerning spacing around displayed math. Why is this stuff not explained somewhere? I checked amsldoc.pdf, Mathmode.pdf, and mathtools.pdf (\SwapAboveDisplaySkip), but no explanation anywhere... –  mafp Dec 28 '12 at 19:33
aligned needs the easy-to-forget prefix \!. –  kiss my armpit Jan 18 '14 at 1:55

split can still work with narrow spaces while aligned cannot!

\documentclass{article}
\usepackage[a6paper,margin=1cm,showframe]{geometry}
\usepackage{pst-node,multido}
\usepackage{amsmath}
\begin{document}
\multido{\n=0.5+0.1}{4}{%
\endgraf\noindent\pnode(.5\linewidth,0){T}
%
\begin{equation*}\!
\begin{aligned}
\framebox[\n\linewidth]{aligned \n}
\end{aligned}\tag*{Def}
\end{equation*}
%
\begin{equation*}
\begin{split}
\framebox[\n\linewidth]{split \n}
\end{split}\tag*{Def}
\end{equation*}
%
\endgraf\noindent\pnode(.5\linewidth,0){B}
\psset{linecolor=blue}
\ncline{T}{B}
\pcline[nodesep=-\dimexpr\n\linewidth/2](B)(B)}
\end{document}

-
What are we supposed to see here? –  mafp Apr 17 '13 at 10:33
@mafp: It should be obvious. –  kiss my armpit Apr 17 '13 at 10:40
No, I don't see it. You say aligned does not work, but the picture looks OK to me. –  mafp Apr 17 '13 at 11:30
@mafp: With aligned the wider box is not properly aligned. –  kiss my armpit Apr 17 '13 at 11:34
This might very well be a feature, to have sufficient space between content and tag. –  mafp Apr 17 '13 at 11:36