I'm trying to enter a long chain of inequalities in math display mode. If I enter the expressions as I want them to, LyX will continue displaying them off the screen - so that they don't show up when I compile the pdf (and I cannot see what I am typing). Is there a way I can enter a long chain of expressions in display mode so that LyX displays them nicely? My only option so far has been to exit display mode when I'm too far right of the screen, hit enter and go back into display mode to enter the next line. However, this doesn't look too great on the pdf, and I have no idea when is a good time to shift to the next line anyway. I'm assuming there is a proper way to do this.
Asked
Active
Viewed 1,432 times
1 Answers
2
As people mentioned in the comments you should use eqnarray or align By default you can do it by pressing Ctrl-Enter in math mode, this will create an eqnarray environment. By pressing Ctrl-Enter again, you can get additional lines. Spacing should be much better than acieved by separate displayed math environments.
To use the AMS align environment, you should tick "Use AMS math package" (first untick "Use AMS math package automatically") in Document->Settings->Math Options. This is probably the best thing to do, as align is much better looking than eqnarrary.
Guy
- 536
- 2
- 9
-
1
alignis not only better looking thaneqnarray; the latter is seriously flawed under many respects and should never be used. – egreg Feb 01 '13 at 09:50
breqnpackage there probably isn't an easy solution to automatic line breaking for display math. – Peter Grill Nov 19 '12 at 05:41\usepackage{breqn}, and then use thedmathenvironment. But I believe is has issues and may be better to just break the equations manually, after finding where they need to break. Have a look at thebreqnquestions. – Peter Grill Nov 19 '12 at 05:50breqnis not a magic bullet - breaking equations is hard work, and you still have to intervene manually in some cases. Also, I doubt that Lyx 'knows' aboutbreqn, so you will have to use direct LaTeX entry ('ERT') to use it. – Joseph Wright Nov 19 '12 at 08:23eqnarrayenvironment and manually places the break points. The improved way is to use the alignment environments provided by theamsmathpackage; again you manually specify the break points; the spacing is better thaneqnarray. Finally, as others mention, there is thebreqnpackage that will automatically break long equations; tweaking its parameters to get output one likes can be frustrating. – Andrew Swann Nov 19 '12 at 09:30eqnarrayis not recommended. See \eqnarray vs \align. – Peter Grill Nov 19 '12 at 10:18\eqnarrayis built in to the latex core,\alignneeds theamsmathpackage. – Andrew Swann Nov 19 '12 at 10:21