1

I need to add & just before = in the aligned environment in LyX to specify the deliminator. So

How to specify the deliminator with & in the aligned environment with LyX?

enter image description here

hhh
  • 8,743
  • i don't use lyx, so i don't know what its conventions are. but is it really impossible to insert & before = in the file? and where you have & & &, two of those should be unnecessary. – barbara beeton Mar 05 '16 at 16:31
  • @barbarabeeton the below is called Source Pane that does not allow me to input any text :/ and the above does not understand & to be the sign to specify the deliminator so I need to find some option to do it. – hhh Mar 05 '16 at 16:43
  • i'm afraid someone more familiar with lyx will have to help. i've just tried looking through the documentation on the lyx site, and though i could find something about eqnarray, there was nothing useful about align. sorry. – barbara beeton Mar 05 '16 at 17:00
  • 1
    Note also that if you know the LaTeX way of doing it you can either do File > Import > LaTeX (plain) or you can do Edit > Paste Special > Paste from LaTeX or if you are feeling daring (in general, this is bad advice) you can try editing the .lyx file directly; often for math the LaTeX is stored there in LaTeX format (as opposed to outside of math where mostly it is in LyX's own format – scottkosty Mar 05 '16 at 17:03
  • @scottkosty is there any LyX way to specify the deliminator like &= in align with written LaTeX? I am getting very bad looking align envs in LyX like here :/ – hhh Mar 05 '16 at 19:56
  • @hhh I do not know – scottkosty Mar 06 '16 at 04:21
  • 1
    I'm not sure I see the problem here. The empty blue boxes represent cells in the aligned-environment, which are separated with & in the generated code. So you need to add everything before = in one box, and the rest of the equation in the next box. – Torbjørn T. Mar 06 '16 at 09:04
  • 1
    http://tex.stackexchange.com/questions/51399/alignement-in-columns-and-spacing-between-columns-of-an-equations-environment and http://tex.stackexchange.com/questions/87490/how-to-left-align-a-set-of-equations-in-lyx – Elad Den Mar 06 '16 at 09:08
  • @EladDen Thank you, I did as instructed in the second thread and asked for clarification from the author: can you clarify the C+L followed by { (I am getting this instead of {empty square}), is it the trick to specify the deliminator with & or do I mistunderstand this thread? And I asked the author to look up this thread. – hhh Mar 06 '16 at 11:28
  • you'll notice in the source that the middle column starts with &=. when doing cntl+L {, I usually get {} in the math mode... – Elad Den Mar 06 '16 at 12:27
  • @EladDen CTRL+L { does not work in my LyX 2.1.4 while CMD+L { works, did you mean CMD+L { in math mode? – hhh Mar 06 '16 at 12:53

2 Answers2

4

Each of those blue boxes in a row specifies something that will be separated by an & in LaTeX. So while you currently have four columns with this content (e.g. on the first row):

  • Nm(1)=Nm(1+0\sqrt{-5})
  • [blank]
  • [blank]
  • Nm(ab)=Nm(a)Nm(b)

... you should instead replace it with four columns with the following content:

  • Nm(1)
  • =Nm(1+0\sqrt{-5})
  • Nm(ab)
  • =Nm(a)Nm(b)

If you want more equations in a row, use the add column button in the table toolbar at the bottom of the screen (it only appears when your cursor is in the equation).

Maybe this seems like LyX is making it hard to get to that LaTeX feature, but those LaTeX &s are column dividers, so if anything I'd say LyX's representation is closer to the philisophical meaning. BTW, a corollary of this is that you cannot have different numbers of &s in different rows, which seemed to be what you're suggesting. LyX's column system makes it impossible to accidentally do this.

Edit: As an unrelated comment, if Nm is meant to be a single identifier rather than the product of N with m, the convention is that it should have upright letters (as e.g. \sin and \exp do). Use a LyX math macro with \operatorname{Nm} for this; see e.g. this blog post for details.

Jim Oldfield
  • 1,263
0

As Jim Oldfield answered, the first row with $I\cdot I$ and the second column with all equality signs below. Also the option Insert > Math > Aligned environment to add the aligned environment in the first hand: I did first adding the array and then the aligned but there may be more convenient ways to this, below the graphical way.

enter image description here

enter image description here

hhh
  • 8,743