Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
      \begin{widetext}
        \begin{displaymath}
        a+b=c;\\
d+e = f;\\
e+m = n;\\
        \end{displaymath}
        \end{widetext}

I am using the above code as an inserted Tex Code in Lyx but I do not get any new lines whether I use \\ or \newline. How do I correct this ?

share|improve this question
4  
You can't have linebreak with display math. Use align*, or gather* if you don't want alignment points. –  Bernard Jul 28 at 21:22
1  
Why are you inserting the LaTeX code rather than using the LyX math editor? –  Jim Oldfield Jul 28 at 22:00
    
Because I did not know how to use the widetext in lyx. So I directly put the code there. –  user25957 Jul 29 at 0:00
3  
Indeed LyX does not support widetext environment. However because your math is inside of it, you could have ERT \begin{widetext} and then normal LyX math or align or however you choose and then afterwards ERT \end{widetext}. It just comes down to a matter of preference though. –  scottkosty Jul 29 at 3:38
1  
@scottkosty You both did in my opinion, in different ways. (Well, you could say that Bernard answered the question as it's written, while you answered the unstated, underlying question.) –  Torbjørn T. Aug 3 at 6:55

1 Answer 1

You can't have linebreaks within display math. Use align*, or gather* if you don't want alignment points.

To have an alignment on the = sign, mark it with an ampersand:

\begin{widetext}
  \begin{align*}
     a+b& =c;\\
    d+e &= f;\\
    e+m &= n;\\
  \end{align*}
\end{widetext}

Note that you may have several alignment points. If you want to have n groups of equations with an alignment, you need 2n–1 ampersands. Example:

\begin{widetext}
  \begin{align}
    a+b &= c; & a'+b'&= c'\\
    d+e &= f; & d'+e' &= f'\\
    e+m &= n; & e'+m' &= n'\\
  \end{align}
\end{widetext}

To have a succession of centred equations, use the gather* environment:

\begin{widetext}
  \begin{gather*}
     a+b =c;\\
    d+e = f;\\
    e+m = n;\\
  \end{gather*}
\end{widetext}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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