## LaTeX forum ⇒ General ⇒ Aligning a system of linear equations

LaTeX specific issues not fitting into one of the other forums of this category.
Plato
Posts: 6
Joined: Wed Nov 19, 2014 7:08 pm

### Aligning a system of linear equations


Hello, I want to align a system of equations such that the x_1, x_2, x_3, x_4, x_5 are all underneath each other. Right now I get my system in staircase-form, like:
x_1 = 2r + s - 3t
......x_2 = r
...........x_3 = -2s + 2t
(there is empty space where the dots are) etc. I want all the x_i's aligned nicely under each other. Can someone help me with this? Thank you in advance.

Tags:

Johannes_B
Site Moderator
Posts: 3883
Joined: Thu Nov 01, 2012 4:08 pm
That is the expected behaviour of the package, try the cases-environment instead.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Stefan Kottwitz
Posts: 9152
Joined: Mon Mar 10, 2008 9:44 pm
To add to what Johannes, said, that package is for aligning terms and signs vertically, such that there's a column for each variable. That's especially good if you got several variables in each row. However, it may look a bit strange in the case of a single variable in each row when all are different. That's the case above.

As Johannes wrote, cases fits better here and is easy to write. In the current situation the terms at the left have roughly the same width. But if you got different widths, it could be good to use additional alignment. Here I change x_5 to x_{10} just as a demonstration. I used the aligned environment instead.


Stefan