[Dev-luatex] nodelist based tex.saveboxresource

Hans Hagen j.hagen at xs4all.nl
Tue Aug 7 13:00:32 CEST 2018


On 8/7/2018 7:23 AM, Marcel Krüger wrote:
>   ---- On Fri, 03 Aug 2018 15:51:24 +0200 Hans Hagen <j.hagen at xs4all.nl> wrote ----
>   > On 8/3/2018 1:09 AM, Marcel Krüger wrote:
>   > > Hello,
>   > >
>   > > I want to suggest extending the tex.saveboxresource interface to accept a hlist or vlist node as an alternative to a box number as first argument.
>   > > Currently creating a boxresource from Lua node list requires saving the list in a TeX box register, only to delete that register again by tex.saveboxresource.
>   > > A direct way to transform a h/vlist into a boxresource would make such code easier and avoid potential side effects from changing the TeX registers.
>   > > An experimental patch with a suggested implementation is attached.
>   >
>   > ok, makes sense (but not entirely ok that way but i can fix it)
>   >
>   > > I also attached a patch implementing a node.scan method which I think would be another nice addition for LuaTeX: It scans a box with rules similar to `\setbox0`
>   > > and returns the node. This allows passing box-like material to LuaTeX without requiring box registers.
>   >
>   > this is tricky stuff so i need to have a close look at side effects
>   > (it's also more relatex to token scanning so belongs in another namespace)
>   >
>   > i'll have a go at it
> 
> Thank you very much. Just so you know while testing the new changes I noticed that the current trunk generates a warning
> 
>       warning  (pdf backend): dangling objects discarded
> 
> for *every* non-empty document.

I'm checking some backend issues and in the process that can happen. If 
trunk generates that then it's something else triggering it.

Experimental is just that: experimental and things can change there 
stuff showing up there can even go. Also, if something is not 
documented, then don't use it. (This dangling is something i noticed and 
will be fixed, in addition to a possible accessor.)

> Anyway there is another maybe more controversial feature I would like to see in LuaTeX: Could you add a callback replacing the built-in `do_delimiter`?
> This would allow creating big delimiter in more flexible ways than just stacking boxes, especially I think about drawing custom-size delimiters using mplib > I am aware that this could be archieved by using the `mlist_to_hlist` 
callback but I think experimenting with delimiter construction should 
not require rewriting the entire mathlist conversion in Lua.

Won't happen. For such fundamental extensions, changes, patches, 
adaptions one can use lua. In fact, drawing delimiters with e.g. mp can 
already be done for many years. It really makes no sense to replace each 
bit. We're now more than a decade in luatex and imo we can do whatever 
we want to extend in lua now. Also, given history it's nearly impossible 
to get an agreement on extensions that have hard coded behaviour.

Probably the only bit that might evolve a bit is cleaning up the 
backend. (And I might start experimenting with a stripped down luatex 
follow up for context some day.)

> Another option might be adding a `<function>` argument to node.mlist_to_hlist which, when not nil, is called to create delimiters.
Won't happen either. Basically we're now at a stage where there will be 
no more extensions added. If needed there will be more parameters to 
replace hard coded values, but that's it.

Hans

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


More information about the dev-luatex mailing list