Hi,
I was wondering if LaTeX could split long formulas automatically, based on invisible splitting points (or hints), in a way similar to hyphenation.
For example, assume you have a large equation that is likely to fit on one line but must be split into two parts if two columns are used. Or maybe someone else (e.g., the editor of a journal) can potentially change the font of your article after you submit it and make the formula suddenly too wide.
MathML specifies hints to help the renderer decide where to split a long formula appropriately. The same long formula can thus appear consistently on various combinations of page/screen widths and font sizes.
So, is there a way to have LaTeX automatically handle long formula (maybe with the help of a special package or external utility)? Has someone else been looking for the same thing before?
Thanks!
Math & Science ⇒ How to split a formula, automatically?
How to split a formula, automatically?
The split environment defined by the amsmath package does what you want.
Although you do have to define the break point manually, and it sounds like you want latex to do it automatically.
Code: Select all
\begin{equation}
\begin{split}
f(x) = a_5x^5 + a_4x^4 +a_3x^3\\
+ a_2x^2 + a_1x +a_0
\end{split}
\end{equation}
Re: How to split a formula, automatically?
I've definitely looked for something like this, but I haven't found it either.
I guess it shows one of the differences between MathML and TeX. Since for the former is designed largely for dynamic displays like webpages, where the user may resize at will, and TeX is designed for print, where resizing won't take place after the fact, so you are encouraged (forced?) to hand-control exactly how you want it to look.
Times are changing though. One day we all might be reading on hand-held devices where the user may want to change font size/margins, etc., him/herself (such as we already have with the Kindle, Nook and Sony Reader, etc.), and if these are going to be used for technical material, hopefully (La)TeX will evolve along with the technology.
I guess it shows one of the differences between MathML and TeX. Since for the former is designed largely for dynamic displays like webpages, where the user may resize at will, and TeX is designed for print, where resizing won't take place after the fact, so you are encouraged (forced?) to hand-control exactly how you want it to look.
Times are changing though. One day we all might be reading on hand-held devices where the user may want to change font size/margins, etc., him/herself (such as we already have with the Kindle, Nook and Sony Reader, etc.), and if these are going to be used for technical material, hopefully (La)TeX will evolve along with the technology.
How to split a formula, automatically?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
How to split a formula, automatically?
Thanks to all for the quick responses. Some comments:
Yes, indeed, thanks! I wasn't aware of that package and it seems to be in line with what I am looking for. It definitely looks worth trying it out.perhaps the breqn package could be of interest for you
Yes. As time goes, more and more publications will be available both online on the web and in PDF for printing. Therefore more interchanges will be needed between (La)TeX and MathML.I guess it shows one of the differences between MathML and TeX. Since for the former is designed largely for dynamic displays like webpages, where the user may resize at will, and TeX is designed for print, where resizing won't take place after the fact, so you are encouraged (forced?) to hand-control exactly how you want it to look.
Times are changing though. One day we all might be reading on hand-held devices where the user may want to change font size/margins, etc., him/herself (such as we already have with the Kindle, Nook and Sony Reader, etc.), and if these are going to be used for technical material, hopefully (La)TeX will evolve along with the technology.