2

(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: enter image description here

And this is what happens what I get out from it:

enter image description here

How can I make that it will be centered?

Thank you!

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

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:

enter image description here

To write something left aligned, put it in the second of these two boxes. To add new columns you click the New column button -- enter image description here -- 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.

5
  • When you write me at the commands "Use the second column of the aligned", what do you mean?
    – heblyx
    Dec 21 '13 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 '13 at 17:11
  • It will be great if you will add a screenshot...
    – heblyx
    Dec 21 '13 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?
    – heblyx
    Dec 21 '13 at 18:05
  • 1
    @YoavFridman As I added to my answer, click the New column-button on the Table toolbar. Dec 21 '13 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.