[luatex] groupcode in pre_linebreak_filter

Frank Mittelbach frank.mittelbach at latex-project.org
Sat Apr 2 00:48:35 CEST 2016


Am 01.04.16 um 18:26 schrieb Frank Mittelbach:
>  From the manual I understand that the groupcode argument in the
> pre_linebreak_filter callback gives me the context where this paragraph
> breaking happens (eg <empty> means main vertical list, vbox means ...)
>
> Unfortunately that doesn't seem to be true:
>
> \directlua{
> require "ltluatex.lua"
> function prelinebreak (head, groupcode)
>   print()
>   print("   groupcode in pre_linelinebreak_filter = " ..
>             groupcode .. " on line " .. tex.inputlineno)
>   return true
> end
> luatexbase.add_to_callback("pre_linebreak_filter", prelinebreak, "new
> linebreak callback")
> }
>
>
> \input tufte
>
> \vbox{\input tufte }
>
> \vbox{\input tufte \par}                         % should report in
> vmode but reports main vlist
>
> \vbox{\begingroup \input tufte \endgroup}
>
> \vbox{\begingroup \input tufte \par\endgroup}    % should report in
> vmode but reports main vlist
>
> looks like the groupcode reported depends on whether it is an explicit
> par or the implicit one from the box but not the actual context
>
> \bye
>
> is this a bug or do I miss something?
>
> The above means I can't really determine if a paragraph is in fact on
> the main vertical list or hidden inside some box so that it is
> unbreakable even if it eventually ends up (as a box) on the main
> vertical list.

as a workaround, I guess I can additionally look at the semantic nest 
pointer and if that is == 1 then I really at at paragraph on the main 
vertical list and if > 1 then not. Is this the right workaround?

frank


More information about the luatex mailing list