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?
Displaying long equationsInsert a double backslash to set a point for the equation to be broken. The first part will be aligned to the left and the second part will be displayed in the next line and aligned to the right.
LyX | LGT (4/5) — Math editor. To insert math use the menu Insert→Math→Inline Formula (shortcut Ctrl+m). This inserts a small blue box which will contain the formula. Note that the math toolbar pops up automatically if the cursor is in a math box.
Yes, but you have to do it by hand.
Check out:
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.
Michael Downes has done some extraordinary Tex coding with this package, but it is not robust enough for general use - it is mostly incompatible with Amsmath, for instance, breaks in hard-to-understand ways, and makes some demonstrably unsound linebreaks in formulae.
Automatic line-breaking in display formulae was listed as one of the top open research problems in Tex.
If you include \usepackage{breqn} in the LyX "LaTeX Preamble" (plus the following code) then the standard "equation" environment (Displayed Formula) will automatically break like you want.
% Add support for automatic equation breaking \gdef\wrap@breqn@environ#1#2{ \expandafter\let\csname breqn@oldbegin@#1\expandafter\endcsname\csname #1\endcsname \expandafter\let\csname breqn@oldend@#1\expandafter\endcsname\csname end#1\endcsname \expandafter\gdef\csname breqn@begin@#1\endcsname{% \expandafter\let\csname #1\expandafter\endcsname\csname breqn@oldbegin@#1\endcsname% \begin{#2}% } \expandafter\gdef\csname breqn@end@#1\endcsname{% \expandafter\let\csname end#1\expandafter\endcsname\csname breqn@oldend@#1\endcsname% \end{#2}% \expandafter\let\csname #1\expandafter\endcsname\csname breqn@begin@#1\endcsname% \expandafter\let\csname end#1\expandafter\endcsname\csname breqn@end@#1\endcsname% } \expandafter\let\csname #1\expandafter\endcsname\csname breqn@begin@#1\endcsname \expandafter\let\csname end#1\expandafter\endcsname\csname breqn@end@#1\endcsname } \wrap@breqn@environ{equation}{dmath} \wrap@breqn@environ{equation*}{dmath*}
If you wish to override the default (unnumbered) LyX equation environment then also add the following:
\DeclareRobustCommand\[{\begin{equation*}} \DeclareRobustCommand\]{\end{equation*}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With