tags:

views:

168

answers:

2

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:

  1. http://stackoverflow.com/questions/2860145/question-about-writing-equations-in-latex
  2. 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
@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
@Amir: Insert a Latex code block directly using "Insert -> TeX Code" (Alt-L).
Charles Stewart
@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
@Aniko @Charles Stewart Thanks, that's exactly what I needed!
Amir Rachum
+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
@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
@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
@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
@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