# How to make the equations at the center

(I'm using LyX).

When I'm writing multiline equations, with `\aligned` the align of the equations is right, how can I make it to be center?

For example: Here how it looks when I writing at math mode: And this is what happens what I get out from it: How can I make that it will be centered?

Thank you!

• Use `gathered`. Dec 21, 2013 at 16:42
• @TorbjørnT. Thank you! and if I want it to be left align, what I need to write? Dec 21, 2013 at 16:48
• Use the second column of the `aligned`. I'll write an answer of sorts. Dec 21, 2013 at 16:50
• I'm waiting for your answer @TorbjørnT. it will be great!!! Thank you! Dec 21, 2013 at 16:53

One normal usecase of `aligned` is to align certain elements, typically the (in)equality signs, of the different lines while having a single equation number for the whole set. (As opposed to numbering each line separately.)

`aligned` is basically a tabular structure where the columns are aligned as `rlrlrlrl...`. That is, the first, third etc. columns are right aligned, the second, fourth etc. are left aligned. To align equations by the equals sign, put the left hand side of the equations in the first column of the `aligned`, the equals sign and the right hand side in the second column. (The `=` should not be in the first column, the spacing will be wrong.)

In LyX, when you do Insert --> Math --> Aligned environment, LyX adds two columns, indicated by the two blue boxes: To write something left aligned, put it in the second of these two boxes. To add new columns you click the New column button -- -- on the Table toolbar (usually found on the bottom of the LyX window).

If you don't need any alignment, use `gathered` instead, which just centres the lines.

Note that both `aligned` and `gathered` are intended for use within other math environments, such as the normal `\[ ... \]` or the `equation` environment. Their counterparts `align` and `gather` are displayed math environments in their own right, and should not be used within other math constructs. `align` and `gather` will number each line, but have also got unnumbered versions, `align*` and `gather*`. The unnumbered versions are used by default in LyX when you do Insert --> Math --> AMS Align/Gather.

• When you write me at the commands "Use the second column of the `aligned`", what do you mean? Dec 21, 2013 at 17:10
• @YoavFridman When you add an `aligned` in LyX there are two boxes, one for each column. I can add a screenshot. Dec 21, 2013 at 17:11
• It will be great if you will add a screenshot... Dec 21, 2013 at 17:13
• What I need to do if I don't get those two boxes? (I get only one) what I need to do? Dec 21, 2013 at 18:05
• @YoavFridman As I added to my answer, click the New column-button on the Table toolbar. Dec 21, 2013 at 18:42