[luatex] node list

Herbert Voss Herbert.Voss at FU-Berlin.DE
Wed Nov 28 12:19:46 CET 2012


Hi,
I am playing with nodes and callbacks to understand how it works.

\directlua{
function checknode(head)
while head do
  if head.id==37 then
   if head.char==string.byte("c") then
    n=node.new(37)
    n.char=string.byte("d")
    n.font=1
    head=node.insert_after(head,head,n)
   end
  end
  if head.id==0 or head.id==1 then checknode(head.list) end
  head=head.next
end
return true
end
callback.register("post_linebreak_filter",checknode,"checknode")}

abc1
\bye

I tried to test "node.insert_after()" instead of using the next and prev
fields. Is it the correct way to use

    head=node.insert_after(head,head,n)

if I want to insert the new glyph node bwtween existing nodes?
And am i right, that the prev field from node n is missing, but
doesn't hurt in this case? I know, that I can set it.

Herbert


More information about the luatex mailing list