2

I used to use ctrl+enter to create aligned equation in LyX. But since I updated to the last version, that does not seem to be working the same way anymore.

I am trying to creat something like this (I wrote this before I updated LyX, and it still worked) enter image description here

The important resources that I need here are the equations that align along the equal sign and that each equation can be numbered. In Lyx, it used to look like this:

enter image description here

I tried using arrays and using rcl as the horizontal alignment option, but that environment does not allow to number each equation separatly and there is less spacing between the equations. It would look like this:

enter image description here

Does anybody know a way around this?

  • I don't know LyX, but I suspect it uses in this case eqnarray which a bad spacing around the alignment point. Isn't there a way to make it use the align environment from amsmath? – Bernard Jun 21 '17 at 14:59
  • @Bernard The latest version seems to use align by default. – Torbjørn T. Jun 21 '17 at 15:00
  • 1
    By latest version, I take it you mean 2.2.3? Ctrl + Enter in a standard display math works fine here (LyX 2.2.3, Kubuntu), it converts the \[ .. \] to an align* environment. How exactly doesn't it work on your system? Finally, the same environment is available via Insert --> Math --> AMS align. – Torbjørn T. Jun 21 '17 at 15:03
  • @TorbjørnT. It seems the spacing isn't the spacing produced by align. But actually, the real problem is not clear. – Bernard Jun 21 '17 at 15:04
  • @Bernard I know that, but the OP says the image is from an older version, so perhaps eqnarray was the default earlier. But anyway, converting is a matter of right-clicking in the equation. – Torbjørn T. Jun 21 '17 at 15:06
  • @TorbjørnT. The AMS Alingnment environment does not work because it alignes all the equations to the right, so the smaller terms are aligned to the right on the right hand side of the equation. – Gustavo Amarante Jun 21 '17 at 15:09
  • You must be doing something wrong, or something other than what I think you're describing. Insert --> Math --> AMS align inserts a two-column math environment, similar to what you show in your second screenshot, where the first column is right aligned and the second is left aligned. Can you describe in detail exactly what you're doing, and show a screenshot that includes the source panel (View --> Source Pane)? – Torbjørn T. Jun 21 '17 at 15:15
  • 1
    Ah, are you inserting a third column? That's wrong. Place both = and the RHS in the second column. This is different from the Eqnarray. – Torbjørn T. Jun 21 '17 at 15:17
  • 1
    @GustavoAmarante for questions like this in the future, please always post a minimal example .lyx file (it is just a text file so you can copy/paste). For more information, please read https://wiki.lyx.org/FAQ/MinimalExample – scottkosty Jun 21 '17 at 16:50
  • @TorbjørnT. Oh! Did not know that! Thanks!!! – Gustavo Amarante Jun 21 '17 at 21:43
  • @scottkosty ok! I will! Thanks for the heads up! – Gustavo Amarante Jun 21 '17 at 21:44

1 Answers1

5

Presumably in older versions of LyX, Ctrl + Enter would convert a standard unnumbered equation into an eqnarray environment. This environment uses three columns to obtain alignment, i.e.

<right aligned> & <center aligned> & <left aligned>

The latest versions instead convert it to an align* environment (from amsmath). This is a good change, because eqnarray should be avoided: eqnarray vs align

It does however work a bit differently, in that it uses two columns to obtain alignment,

<right aligned> & <left aligned>

So now in newer versions of LyX, don't add the third column, instead add both = and the RHS in the second column. The third column is again right aligned, as the columns in an align form rl pairs, see e.g. What does a double ampersand (&&) mean in LaTeX?

Torbjørn T.
  • 206,688