[luatex] groupcode in pre_linebreak_filter

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Apr 1 18:26:18 CEST 2016


 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.

thanks
frank


More information about the luatex mailing list