I'm wondering why, in the following code, the first \hbox{} is not seen by the lua function while the second one is seen i.e. \hbox{} at paragraph beginning isn't seen. \directlua0{ local function traverse(h) for n in node.traverse (h) do texio.write_nl('node id='..node.type(n.id)) if n.id == node.id('hlist') then traverse(n.list) end end end callback.register('pre_linebreak_filter', function(h) traverse(h) return true end ) } \hbox{Not seen} Hello \hbox{seen} \bye Regards, -- Khaled Hosny Arabic localizer and member of Arabeyes.org team
On Thu, 30 Oct 2008, Khaled Hosny wrote:
I'm wondering why, in the following code, the first \hbox{} is not seen by the lua function while the second one is seen i.e. \hbox{} at paragraph beginning isn't seen.
\directlua0{ local function traverse(h) for n in node.traverse (h) do texio.write_nl('node id='..node.type(n.id)) if n.id == node.id('hlist') then traverse(n.list) end end end callback.register('pre_linebreak_filter', function(h) traverse(h) return true end ) }
\hbox{Not seen}
that's just a \hbox{} within the page's \vbox{}, it's not starting a paragraph. A \hbox{} at the beginning of a new paragraph you would get e. g., by \leavevmode\hbox{Seen}.
Hello \hbox{seen} \bye
Regards, Hartmut
On Thu, Oct 30, 2008 at 11:32:48PM +0100, Hartmut Henkel wrote:
On Thu, 30 Oct 2008, Khaled Hosny wrote:
\hbox{Not seen}
that's just a \hbox{} within the page's \vbox{}, it's not starting a paragraph. A \hbox{} at the beginning of a new paragraph you would get e. g., by \leavevmode\hbox{Seen}.
Thanks for the explanation, my question is how I go through the nodes in that \hbox not getting a box at start of paragraph. Regards, -- Khaled Hosny Arabic localizer and member of Arabeyes.org team
On Fri, 31 Oct 2008, Khaled Hosny wrote:
On Thu, Oct 30, 2008 at 11:32:48PM +0100, Hartmut Henkel wrote:
On Thu, 30 Oct 2008, Khaled Hosny wrote:
\hbox{Not seen}
that's just a \hbox{} within the page's \vbox{}, it's not starting a paragraph. A \hbox{} at the beginning of a new paragraph you would get e. g., by \leavevmode\hbox{Seen}.
my question is how I go through the nodes in that \hbox not getting a box at start of paragraph.
seems it works through the hpack_filter: % just to get rid of header/footer boxes from plain.tex \catcode`@=11 \def\plainoutput{\shipout\vbox{\pagebody}% \advancepageno \ifnum\outputpenalty>-\@MM \else\dosupereject\fi} \catcode`@=12 \directlua0{ local function traverse(h) for n in node.traverse (h) do texio.write_nl('node id='..node.type(n.id)) if n.id == node.id('hlist') then traverse(n.list) end end end callback.register('hpack_filter', function(h,a) texio.write_nl("=== "..a) traverse(h) return true end ) } \hbox{Also seen} Hello \hbox{seen} \bye Regards, Hartmut
On Fri, Oct 31, 2008 at 01:21:24AM +0100, Hartmut Henkel wrote:
On Fri, 31 Oct 2008, Khaled Hosny wrote:
On Thu, Oct 30, 2008 at 11:32:48PM +0100, Hartmut Henkel wrote:
On Thu, 30 Oct 2008, Khaled Hosny wrote:
\hbox{Not seen}
that's just a \hbox{} within the page's \vbox{}, it's not starting a paragraph. A \hbox{} at the beginning of a new paragraph you would get e. g., by \leavevmode\hbox{Seen}.
my question is how I go through the nodes in that \hbox not getting a box at start of paragraph.
seems it works through the hpack_filter:
This did it, thanks for the help. Regards, -- Khaled Hosny Arabic localizer and member of Arabeyes.org team
participants (2)
-
Hartmut Henkel
-
Khaled Hosny