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 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{equation}
  \begin{array}{ccl}
    a + b + c & = & d \\
    e + f     & = & g \\
    h         & = & i
  \end{array}
\end{equation}

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 :

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

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

share|improve this question
3  
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
4  
1  
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

1 Answer 1

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

enter image description here

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

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

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

\end{document}
share|improve this answer

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.