Here, we met another issue regarding equation editing in Lyx: the long equations do not wrap automatically. There is a 3-step method to solve this problem.
1. First make sure you have installed the hm package, which includes breqn package.
2. Change Math tab in document settings to hm~~. Be sure only let this option checked.
3. Add the following code to the preample:
\usepackage{breqn}
% 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*}
Now choose "displayed formula" to create or edit equations.
That's it!
No comments:
Post a Comment