On 5/29/2024 10:08 PM, Linas Stonys wrote:
I know I'm asking impossible but who knows...
Maybe in the "near" future luatex could adapt user_defined whatsit to
have some more fields where it could store lastskip, lastpenalty, ...
So that \last... checkers could point to this corresponding field to
check the value if it sees that last node is user_defined whatsit
that would then also involve some guesswork and be somewhat alien to how
these state variables are handled
you could set a property (or attribute) on x that stores the skip, and
then redefine lastskip to look at the list and if found fetch that value
or otherwise report the normal one
or you can be adventurous and intercept the builder in a callback
:)
because injecting whatsits this way will likely mess up your page
building unless you take precautions you can as well do something
aa
\vskip10pt
\skip0\lastskip
\vskip-\lastskip
\directlua{%
local x = node.new('whatsit', 'user_defined')
x.type = 115
x.value = "TEXT"
node.write(x)
}%
\vskip\skip0
bb
with a bit testing and maybe some penalties .. it all depends on how /
what / where you inject, after all you probably want to keep the whatsit
bound to what comes before anyway (as you check the skip)
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
-----------------------------------------------------------------
_______________________________________________
dev-luatex mailing list -- dev-luatex@ntg.nl
To unsubscribe send an email to dev-luatex-le...@ntg.nl