On 5/29/2024 8:58 PM, Linas Stonys wrote:
Hi, I'm sure that for lua gurus it is known behavior that user_defined whatsit clears the \lastskip but for me it was a big surprise.
little example: aa \vskip11.1pt \showthe\lastskip \directlua{% local x = node.new('whatsit', 'user_defined') x.type=115 x.value="TEXT" node.write(x) }% \showthe\lastskip \bye
log:
11.1pt. l.4 \showthe\lastskip
?
0.0pt. l.13 \showthe\lastskip
I just accidentally noticed that I messed up output trying to markup document. I was sure that luatex will step over these whatsits.
Is there another way to write user_defined whatsits directly without effecting \lastskip? My goal is to mark text in DVI mode with user_defined whatsits and on the shipout turn them to postscript \special's for accessible pdf I'd probably try to insert before the last glue in a list but it all depends one the macro package and what it does with skips etc in various
Why? We also have \lastpenalty etc and if would become confusing if last means "last seen" instead of last on the list. It's not a register but a 'reference to a stored state'. You could check the lastskip before you write the whatsit, maybe backtrack i.e. remove it, insert the whatsit and then reinsert the glue node or otherwise insert the whatsit before the last node if it's a skip (you can mess with the current list) places. 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 -----------------------------------------------------------------