Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
6  
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
1  
Actually, the 2nd example would work just fine without split, and as @Mico says, the 1st one can use simple equation instead of gather. –  tohecz Jul 19 '12 at 16:22
1  
@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. –  Please don't touch Dec 30 '12 at 1:53

2 Answers 2

up vote 17 down vote accepted
+50

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
\begin{equation}\tag{EA}
\begin{aligned}
x &= a + b\\
y &= c+ d
\end{aligned}
\end{equation}
\lipsum*[2]
%==================
% equation+split
\begin{equation}\tag{ES}
\begin{split}
x &= a + b\\
y &= c+ d
\end{split}
\end{equation}
\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).

enter image description here

share|improve this answer
    
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"? –  Please don't touch Nov 4 '12 at 13:59
1  
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 \!. –  Please don't touch Jan 18 at 1:55

split can still work with narrow spaces while aligned cannot!

enter image description here

\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}
share|improve this answer
1  
What are we supposed to see here? –  mafp Apr 17 '13 at 10:33
    
@mafp: It should be obvious. –  Please don't touch Apr 17 '13 at 10:40
1  
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
1  
@mafp: With aligned the wider box is not properly aligned. –  Please don't touch Apr 17 '13 at 11:34
1  
This might very well be a feature, to have sufficient space between content and tag. –  mafp Apr 17 '13 at 11:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.