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. 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. Best regards Marcel
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 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 -----------------------------------------------------------------
On 8/4/2018 7:44 PM, Thomas de Vivo wrote:
dear dev-luatex list, I'm an estimator of (La)Tex and the work done Donald Knuth -- as well as the work that you all are doing -- and I'm following this list since a while. Few time ago I have been in touch with Patrick Gundlach of https://www.speedata.de/en/ a publishing system based on LuateX. My concern and goal would be to be able to control the looseness of paragraphs while paging a text, so to minimize widows and orphans in the resulting document. In practical terms, when the system finds that a widow is being produced, then it tries to make the relevant paragraph more dense, or even more than one, in order to fit all the text in the page. (This is not currently possible using Speedata) I would like to know whether LuaTex offers such control, on in other terms whether the pagination algorithm is as sophisticated as the famous linebreak algorithm of Tex/Latex. (thing in my opinion highly desirable) Alternatively, I would like to know what files I have to check in the distribution of Lua to reach such a result. You can write callbacks functions that do such things; after all you have access to the internals. It could work out ok for trivial documents but the times i played with it myself but in the end the interaction between different mechanisme, conflicting demands etc make a fully unattended automatic mechanmism that meets all demands kind of hard. (IRR, Don Knuth somewhere suggests to adapt the text in hard to cover cases.).
This is why we're not adding more heuristics to the core but expect users to use callbacks and mess around with lua. 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 -----------------------------------------------------------------
Am 04.08.18 um 19:44 schrieb Thomas de Vivo:
dear dev-luatex list, I'm an estimator of (La)Tex and the work done Donald Knuth -- as well as the work that you all are doing -- and I'm following this list since a while. Few time ago I have been in touch with Patrick Gundlach of https://www.speedata.de/en/ a publishing system based on LuateX. My concern and goal would be to be able to control the looseness of paragraphs while paging a text, so to minimize widows and orphans in the resulting document. In practical terms, when the system finds that a widow is being produced, then it tries to make the relevant paragraph more dense, or even more than one, in order to fit all the text in the page. (This is not currently possible using Speedata) I would like to know whether LuaTex offers such control, on in other terms whether the pagination algorithm is as sophisticated as the famous linebreak algorithm of Tex/Latex. (thing in my opinion highly desirable) Alternatively, I would like to know what files I have to check in the distribution of Lua to reach such a result. Thank you and kind regards (Thomas)
as Hans said, there is no production code in that space, largely due to the fact that the problems in that space are very difficult to solve (often NP) and managing the real-life conflicting requirements is challenging. And if you restrict yourself then the class of documents that can be handled gets very limited. I have done some research on that in the last couple of years and the result can be found at: https://www.latex-project.org/publications/indexbytopic/pagination/ Basically this proves that suitable results can be produced in adequate time spans (under reasonable conditions) but so far I have only published the research not any code --- doing the latter would mean further work that I estimate at several hundreds of hours so I'm not sure when that can be undertaken (unless I find sponsors for it) frank
participants (4)
-
Frank Mittelbach
-
Hans Hagen
-
Marcel Krüger
-
Thomas de Vivo