# [lltx] linebreak_filter problems

Frank Mittelbach frank.mittelbach at latex-project.org
Sun Jun 10 16:50:26 CEST 2012

Hi folks,

can somebody help me to identify if I do something wrong or if there is
a bug with linebreak_filter.

Th problem is documented at length in

http://tex.stackexchange.com/questions/59176/lastnodetype-not-working-as-expected-in-luatex

In a nutshell I try to replace (at certain times) TeX's linebreaking
algorithm and replace it with a simple version that just packs up the
hlist into an hbox and returns that.

If I do that the resulting box appears on the current vertical list (ie
is seen via \showlists) but at the same time

\lastnotetype  returns -1
\lastbox       picks up a void box

ie to some parts of TeX the list appears to be empty. Here is an MWE

\def\partest{%
\directlua{%
end
callback.register("linebreak_filter", hpackparagraph)
}%
\par
}

\setbox0\vbox{ABC\par

\showthe\lastnodetype
}

\setbox0\vbox{ABC\partest