LyXEqnarray-Environment with Aligned Text

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Stanislaus Gurjewitsch
Posts: 1
Joined: Fri Dec 11, 2009 12:03 pm

Eqnarray-Environment with Aligned Text

Post by Stanislaus Gurjewitsch »

Hello!

I want to display several formulas with numeration, but I also need a "comment" for each formula:

Code: Select all

(1)  X = Y + Z       (Using theorem Xy)
(2)  X = Y + A + A   (Doing ....)
(3)  ...
But all I can get is this (if I put the text directly after the equations)

Code: Select all

(1) X = Y + Z (Using theorem Xy)
(2) X = Y + A + A (Doing ....)
(3) ...
Is there a way to align (just) the text to the right? (without doing it manually)
Is Eqnarray the right choice?

I'm a LaTeX and LyX newbie, I hope you can help me :)
Thanks in advance

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Eqnarray-Environment with Aligned Text

Post by php1ic »

Hi Stanislaus,

The eqnarray environment has inconsistent spacing so use align instead. One of the moderators has written an article about why

http://texblog.net/latex-archive/maths/ ... vironment/

For your problem, the code below seems to do what you want.

Code: Select all

\begin{align}
x &= y+z   &&\mbox{(Using theorem xy)}\\
x &= y+a+a &&\mbox{(Doing)}
\end{align}
Post Reply