David Kastrup wrote:
Taco Hoekwater
writes: Taco Hoekwater wrote:
Hi,
I have just uploaded the archives for a new luatex release, 0.51.0.
New features:
Actually, there is another feature but it is experimental enough that it is not documented in the manual yet.
local <node> nodelist, <sp> founddepth = tex.linebreak(<node> listhead, <table> parameters)
The understood parameters are as follows (with example code):
A few notes: badness/demerits output?
I'll see what can be done about that.
And I think it would be beneficial to have incremental line breaking, where you have as an input (and output) the list of current best breakpoints. That would make it possible to have text flow around shapes without requiring everything to fit a fixed base line distance.
Here I am not sure what you have in mind exactly. Can you create a mock up of the requested input/output? I will also say that -- before you spend a lot of time on this -- there are plans for a pure lua version of the whole line break algorithm. We did some experiments with that, and it is not noticeably slower on an average (context) document.
It also would make it possible to develop strategies for adjusting line break decisions depending on pagebreaks (\brokenpenalty, \widowpenalty and their ilk can't have the paragraph rebroken right now, making them pretty useless with fixed bottom page layouts).
You can already re-break the paragraph with the current tex.linebreak: just create a copy of the node list before feeding it in, and loop over the output boxes. tex.linebreak does not remove or reallocate those existing nodes, at most it hides them in discretionaries inside hlists. Probably this is not quite what you had in mind, though. Best wishes, Taco