How can I break long formulas in LyX into two (or more) lines? I know how to write several lines of equations in one "math box" but I'm looking for a solution to break lines even in the middle of a parenthesis. I'm using LyX 1.6.4 and currently, when the formula is too big, it doesn't do anything (it just doesn't print the last segment of it, which is "beyond" the page). Is this possible in LyX?
+1
A:
Yes, but you have to do it by hand.
Check out:
- http://stackoverflow.com/questions/2860145/question-about-writing-equations-in-latex
- http://stackoverflow.com/questions/1436529/latex-multiline-equations
Lyx has an "Insert -> Math -> AMS multline environment" control, or you can use the solutions recommended above by entering Latex directly using the Insert Latex control.
Charles Stewart
2010-05-25 13:06:29
@Charles Stewart The AMS Multiline environment works, but not in the middle of a parenthesis, which is surrounding most of my equation. Is there a solution that does that?
Amir Rachum
2010-05-25 13:21:29
@Amir: Insert a Latex code block directly using "Insert -> TeX Code" (Alt-L).
Charles Stewart
2010-05-25 13:28:01
@Amir: if you mean '\left('-type self-sizing parentheses, then you cannot really use them with 'multline'. Either close with '\right.' before line-break (and reopen with '\left.') which can lead to parentheses of different size, or size them yourself using '\big(', '\Big(', '\Bigg(', etc.
Aniko
2010-05-25 13:52:37
@Aniko @Charles Stewart Thanks, that's exactly what I needed!
Amir Rachum
2010-05-25 14:06:07
+1
A:
You might want to try the breqn
package. It provides automatic line breaking for big formulas. This way there is no need for manually fixing your delimiters or choosing the break points. Of course, this is no actual LyX functionality but it does exactly what you want.
Pieter
2010-05-26 16:36:09
@Pieter For some reason MikTeX can't install this automatically. What do I do with the dtx file I downloaded from your link?
Amir Rachum
2010-05-26 20:53:02
@Amir There is an installation guide provided in both the README and the actual .dtx file, these might be a good start :). My MikTeX installed the `mh` bundle correcty by the way, so it should be possible without having to resort to manual installation.
Pieter
2010-05-26 21:10:14
@Pieter Installed it, added `\usepackage{breqn}` to latex preamble and it doesn't do anything. I didn't understand from the document if I need to use any special command in the document.
Amir Rachum
2010-05-26 21:23:31
@Amir You have to replace the math environments LyX used for you with `dmath` environments. And make sure you use your delimiters and operators properly.
Pieter
2010-05-27 05:46:29