[luatex] node missing

Andreas Matthias andreas.matthias at gmail.com
Sun Jan 22 16:56:22 CET 2012


In the following example I expected \mybox to contain `abc'
eventually. Instead it only contains `bc'. Why is the `a'
missing?

Ciao
Andreas



\tracingonline=1
\showboxdepth=\maxdimen
\showboxbreadth=\maxdimen

\newbox\mybox

\def\bar#1{%
  \setbox\mybox=\hbox{#1}%
  \directlua {%

    function foo (box)
      n1 = node.new(node.id('glyph'))
      n1.char = 97
      n1.font = 1

      n2 = node.new(node.id('glyph'))
      n2.char = 99
      n2.font = 1

      n1.next = box.head
      tail = node.slide(n1)
      tail.next = n2      
      node.slide(n1)
      h = node.hpack(n1)

      print()
      for i in node.traverse(h.head) do
        print(i, i.char)
      end

      return h
    end

    tex.setbox(mybox, foo(tex.box.mybox))

 }}


\bar{b}
\showbox\mybox

\leavevmode\copy\mybox

\bye



More information about the luatex mailing list