1

My question is the same as this question, but in the context of LyX. The solution for that question was to put the & before = sign.

I manually implemented this tweak in LyX, by changing the raw math code (see below).

My question is this: How do I change the \align environment in LyX so that it automatically accomplishes this tweak every time I use the \align environment? (Instead of having to manually change the raw code for every instance as I did here.)

What I did in LyX:

enter image description here

What the output PDF looks like:

enter image description here

What the TeX code looks like:

\begin{document}
Default \LyX{} align Environment:

\begin{alignat*}{1}
x= & y\\
= & z
\end{alignat*}


Tweaked (to get desired result):

\begin{alignat*}{1}
x & =y\\
 & =z
\end{alignat*}

\end{document}

In response to a comment, I tried putting the "=" sign at all possible positions. Here are the 4 permutations.

enter image description here

The result is not as desired:

enter image description here

closed as unclear what you're asking by Torbjørn T., Mico, TeXnician, egreg, Zarko Jun 5 '17 at 11:08

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Why don't you use the align* environment? alignat is made for more than one alignment group. – Bernard Apr 4 '16 at 1:18
  • @Bernard: To be honest, I don't know what the difference is. I happened to use alignat when I first used LyX and that's what I've used ever since. I can perceive no difference between the two. The same problem (described in my above question) still occurs when I use align. – Kenny LJ Apr 4 '16 at 1:23
  • 3
    if lyx is putting the & after the =, then lyx is wrong, and a report should be made to the maintainers. (the recommended/required order is documented in the user's guide for amsmath. that manual also describes the difference between allign and alignat.) – barbara beeton Apr 4 '16 at 1:34
  • 1
    @barbarabeeton LyX doesn't put the = anywhere, the user does, so if it ends up the wrong side of the & it's because the user entered the = in the wrong column. Kenny: Put the = in the second column. – Torbjørn T. Apr 4 '16 at 10:23
  • 1
    alignat isn't designed for setting a=y=a it is designed for a=y b=x – David Carlisle Apr 4 '16 at 11:31

Browse other questions tagged or ask your own question.