On Thu, 9 Aug 2012, Sietse Brouwer wrote:

Steffen Wolfrum wrote:
them to break automatically ... is there a handy solution?

Aditya Mahajan wrote:
Short answer: No easy solution exists.

Is this because allowing automatic line breaks in math mode is itself
hard to implement, or is the basic mechanism possible but preventing
stupid/ugly breakpoints is hard? Because I can imagine a 70 percent
solution being a big help already.

Partly both.

The question is not so much the difficulty in choosing break-points (which is easy: before all \mathbin atoms, after \mathpunct if needed, etc). The hard part is how to align the split up portions, and choosing different alignments changes the line widths, and therefore affect future line-breaks.

The old manual of breqn (the one by Michel Jones) had some discussion on the different alignment of display math. They are also explained nicely in the book on typesetting math by AMS (I forget the author's name).

In principle, one can follow the same approach as Knuth did for line-breaking text (define penalties and then solve a dynamic program to find the layout that gives the lowest score). The breqn package does implement such an algorithm that works well in most cases. I wish that the breqn algorithm were described somethere; then one could play around implementing it in luatex. Trying to read breqn code to understand the algorithm is very difficult.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to