[luatex] Request for Callback

Hans Hagen pragma at wxs.nl
Fri Jun 28 10:44:16 CEST 2013


On 6/28/2013 9:19 AM, Élie Roux wrote:
>>> it would complicate the already complex algorithm and once we start
>>> adding callbacks *in* core mechanisms we notonly get a slow down but
>>> also an endless list of additional subcallbacks and dependencies
>>
>> I'll think about this anyway, but I suspect Hans is right, and that
>> there is no 'good' spot to insert callbacks within the line breaking,
>> and doing the whole thing in lua may well be the best solution.
>
> Dear all,
>
> Thank you very much for your answer! I suspected this kind of
> difficulties, and I trust you know better than me if it's doable or not.
>
> By the way, Hans, I heard you already reimplemented the TeX linebreak
> algorithm in pure Lua, can your code be found somewhere?

on my machine ... i'm waiting for the new hz in the backend before 
putting it in the context distribution because i don't want to end up 
with several versions (and i then need to prune some test code) ... so 
some patience is needed ...

btw there was an article on it some time ago, also in: 
http://www.pragma-ade.com/general/manuals/hybrid.pdf, p 101

one thing you could play with is storing the paragraph before it gets 
broken, then let tex do the job, analyze afterwards, and when not ok, 
add some penalties and let tex do the job again

but it might be better to rethink this special case (which is unlikely 
to mix with all those things that can end up in paragraphs, i.e. it's a 
limited tex-only case), and cook up something dedicated, at least that's 
the approach i'd choose as soon as context users start asking for such 
features

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the luatex mailing list