On Tuesday, November 29, 2005 11:37 PM C Y wrote: > ... > > The line breaker code (written by Robert Sutor - one of the > > original Axiom developers) that we use with Axiom on both > > MathAction and in the Windows version of the TeXmacs interface > > is written in C. The original version was run as a filter > > but I adapted it slightly to be called as a subroutine. It > > accepts a few parameters, one of which is the desired line > > size. > > The problem is how do we know what the size of an equation is > relative to our page size in the output until we render it?
We just say we want an equation that is 4.5 inches wide and the algorithm tries really hard to make it that size by converting the equation into an eqnarry, based on a set of heuristics like preferentially breaking on a + in a sum etc. I a few other heuristics involving how to break a product and how to handle functions etc. But in some cases it will fail to achieve the desired size. You can see the effect of this on some pages in MathAction. > > The general solution to this problem is actually an > interesting research problem, as well as an immense > challenge. :-). > If you can read old-fashioned C program code, then I think you should take a look at this. It seems to me that Robert Sutor more or less solved this "research problem" about 15 years ago. :) Seriously, if you are interested and know C, then there are a few things like I would like to do to improve the algorithm... but it is not much fun doing it all on my own. At the moment it is not in the form a pamphlet file and has very little documentation in the code. But if anyone wants to work on this, I would be glad to set it up in the form of a pamphlet on MathAction. Regards, Bill Page. _______________________________________________ Axiom-developer mailing list Axiom-developer@nongnu.org http://lists.nongnu.org/mailman/listinfo/axiom-developer