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.

I don't understand the difference between the split and aligned environments introduced by amsmath, so I'm posting this question as a place to collect what subtle details there may be. One thing observable straight off is that split only works with two columns, whereas aligned works with an arbitrary number of columns. But they are similar in other immediately visible ways:

  • Both have to be wrapped in another math-introducing environment, like \begin{equation}...\end{equation}
  • Both permit only a single \tag{...} for the entire group, not one tag for each line (EDIT: not sure where I got that impression, in fact neither permits any \tag, though aligned's friend gathered does permit a single \tag, as described here)

I searched existing questions on this site about what differences there may be between these environments. I did find this question: Difference between (split, align) and (gather, aligned)?, where---despite the title and phrasing of the question---most of the answers focus just on the difference between the split and aligned environments themselves.

EDIT: Collecting the differences noted so far.

  • As one answer to the above question points out, inside equation environments (but not inside gather or align environments), the split and aligned environments have different vertical spacing from the surrounding text.

  • As another answer to that question points out, when the body of these environments gets very long, their horizontal placement starts to diverge.

  • As Mico noted in comments, section 3.7 of the amsmath User Guide notes that aligned (together with alignedat and gathered) accepts an optional [t] or [b] argument, for explicit vertical placement of any equation tags. split does not accept any such argument.

  • As egreg notes in his answer, split will on the other hand honor the tbtags or (default) centertags option to the amsmath package. Whereas aligned and its friends will not.

  • As Mico's comments also suggested, but I did not immediately appreciate, split is not supposed to go together with any other typeset material on the same display line. On the other hand, aligned and its friends can be freely combined with other unaligned materials, or even other blocks of aligned and so on. They will be horizontally juxtaposed and vertically centered. I've explained this further in an answer below.

Perhaps that exhausts the differences between split and aligned: though if others know of other differences, please point them out.

share|improve this question
1  
Did you check out section 3.7, "Alignment building blocks", of the user guide of the amsmath package? It mentions two important differences -- in addition to the ones you mention in your write-up -- between the split environment on the one hand and the aligned environment (and its close relatives, the gathered and alignedat environments) on the other. –  Mico Jul 4 at 4:40
    
Thanks for the reference, I was reading through that guide currently. (Searching on it turned up too many results.) That section doesn't explicitly mention split. Of the two features cited there, the first (permitting additional unaligned text on the same row) doesn't distinguish aligned and friends (gathered, alignedat) from split, at least that's what my testing shows. The other feature cited there is different between them: aligned and friends take an optional [t] or [b] argument, but split does not. –  dubiousjim Jul 4 at 4:47
    
Since split is generally used inside environments such as equation and equation*, what's said in the first two sentences of the first paragraph of section 3.7 of the user guide (i) does apply to split (even though split isn't mentioned "explicitly"...) and (ii) helps set up distinguish what's different about aligned (and gathered and alignedat). –  Mico Jul 4 at 4:53
    
But aligned also has to be used inside equation or the like; there is no difference there with respect to split. And if you try it, you'll see that you can add further unaligned text on the same equation line, after either of them. That is: begin{equation}\begin{XXX}...\end{XXX}\text{ hello}\end{equation} gives the same results whether XXX is aligned or split. (And in neither case can the begin{equation} or something similar be omitted.) –  dubiousjim Jul 4 at 4:57
    
In your last comment you use something outside the inner environment (\text); In that case I tend to use aligned. I only use split inside equations, when I want to split them; but not only a part (because that would be “aligning”), I use split when the whole equation must be divided, hence the construction is always (in my case) \begin{equation}\begin{split} … \end{split}\end{equation} (or equation*). –  Manuel Jul 4 at 7:54

2 Answers 2

One important difference is that split obeys to the centertags (default) or tbtags option. Here is an example

\documentclass[twocolumn]{article}
\usepackage[
%  tbtags,
%  leqno,
]{amsmath}
\begin{document}
\begin{align}
a&=b\\
\begin{split}
c&=d+{}\\
 &=e+{}\\
 &=f
\end{split}\\
g&=h
\end{align}
\end{document}

enter image description here

Now the same with uncommented tbtags:

enter image description here

Now also leqno is uncommented:

enter image description here

To the contrary, aligned will have the equation number according to the vertical alignment option: centered for \begin{aligned}...\end{aligned}, at the top for \begin{aligned}[t]...\end{aligned}, at the bottom for \begin{aligned}[b]...\end{aligned}. Thus it's better to use split whenever possible, if equation numbers are involved. (I rarely use equation numbers, so I usually don't bother.)

share|improve this answer

Here's another difference I notice. According to the AMS User Guide (p. 6 and p. 29 in the Version 2.0 copy I have):

The split structure should constitute the entire body of the enclosing struc- ture, apart from commands like \label that produce no visible material.

The split environment is designed to serve as the entire body of an equation, or an entire line of an align or gather environment. There cannot be any printed material before or after it within the same enclosing structure:

\begin{equation}
\left\{ % <-- Not allowed
\begin{split}
...
\end{split}
\right. % <-- Not allowed
\end{equation}

However, in my testing (conducted before reading these passages), this constraint seems nowadays often not to be enforced. Here's an example that doesn't work:

\documentclass[]{article}
\usepackage{amssymb,amsmath}
\begin{document}

\begin{equation}
\begin{aligned}
y=0
\end{aligned}
\qquad
\left. \begin{aligned}
B'&=-\partial\times E,\\
E'&=\partial\times B - 4\pi j,
\end{aligned}
\right\}
\qquad \text{Maxwell’s equations}
\qquad
\begin{aligned}
x=0
\end{aligned}
\end{equation}

\begin{equation}
% \begin{split}
% y=0
% \end{split}
% \qquad
\left. \begin{split}
B'&=-\partial\times E,\\
E'&=\partial\times B - 4\pi j,
\end{split}
\right\}
\qquad \text{Maxwell’s equations}
\enspace
\begin{split}
x=0
\end{split}
\end{equation}

\end{document}

which produces: LaTeX output

and in the log we see a related error message:

Package amsmath Warning: Cannot use `split' here; (amsmath) trying to recover with `aligned' on input line 31.

However, if the comments are removed from the previous source, then it typesets fine (and there is no Warning in the log):

LaTex output

The horizontal spacing is just a bit different from that of aligned. I wish I understood better why multiple splits on the same display line works in the second case but not the first. Still, it is clear that the docs say this is not its intended use, and as the first example shows, it can't be expected to perform that use reliably. If you want an aligned block of equations on a line together with additional material (including but not only including other aligned blocks), you're supposed to use aligned and friends (alignedat, gathered).

share|improve this answer
    
Another difference is tex.stackexchange.com/q/192069/19356. –  Who is crazy first Jul 18 at 17:13

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.