# Systems of equations with a single number

I want to write a numbered system of equations. Right now, this is what I do and I am satisfied with the output, but I have a feeling it's not the best way to do it.

$$\begin{array}{ccl} a + b + c & = & d \\ e + f & = & g \\ h & = & i \end{array}$$


How should I handle system of equations with a single number associated to it?

UPDATE :

I have read the asmmath package documentation and I feel more comfortable with what it offers. However, are there still some situations in which using the array environment is still relevant. For example, I would not know how to produce this result otherwise :

$$\left\{ \begin{array}{lcl} x_1 + x_2 + x_3 & = & 1 \\ x_1 + x_2 & = & 2 \\ x_1 & = & 3 \end{array} \right.$$


In the case the spacing seems correct, and it would not bee desirable to have the first column aligned to the = sign.

-
Better use the split environment of amsmath in the equation environment, or aligned. Have a look at the examples here and compare: Difference between (split, align) and (gather, aligned). I'm sure this question has been asked before - perhaps somebody finds the duplicate, a better matching one than I linked? –  Stefan Kottwitz Dec 21 '12 at 8:40
Welcome to TeX.sx! –  Andrew Swann Dec 21 '12 at 8:54
No, the spacing in the EDIT part is not correct. Use \begin{array}{l@{}c@{}l} and input lines like x_1+x_2 & {}={} & 2. You'll see the difference. –  egreg Dec 21 '12 at 19:07
The correct math spacing with array can be achieved if you you use \begin{array}{r@{}l}, and then use {}= as in a + b + c &{}= d. –  Peter Grill Dec 21 '12 at 19:08

The spacing is all wrong if you use an array, the AMS alignments provide alignment whilst preserving operator spacing:

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

$$\begin{array}{ccl} a + b + c & = & d \\ e + f & = & g \\ h & = & i \end{array}$$

\begin{aligned} a + b + c & = d \\ e + f & = g \\ h & = i \end{aligned}

\end{document}

-