[NTG-context] Callbacks (and nodes) in LuaMetaTeX

Max Chernoff mseven at telus.net
Wed May 25 12:07:53 CEST 2022


Hi list,

I haven't had any luck solving any of the issues from my previous email:

     [NTG-context] Callbacks in LuaMetaTeX
     https://mailman.ntg.nl/pipermail/ntg-context/2022/105566.html

Admittedly, my problems are fairly obscure (and likely self-inflicted), 
but any suggestions would be greatly appreciated. I've updated my 
ConTeXt installation to the latest version (mkxl 2022.05.11 11:36), but 
this doesn't seem to have changed anything.

Further to the previous email, I have one (semi-related) additional 
question:

6. The LuaTeX manual says that the subtype of "ins" nodes is a number
    corresponding to the insert class. This appears to work correctly.
    The LuaMetaTeX manual says the same thing about "insert" nodes;
    however, the subtype of "insert" nodes appears to always be zero.

    Using this code:

        \startluacode
            local traverse_id = node.traverse_id or node.traverseid
            local insert = node.id"insert" or node.id"ins"

            function test(head)
                for n in traverse_id(insert, head) do
                    inspect(n)
                    print(n.subtype)
                end

                return head
            end

            nodes.tasks.appendaction("finalizers", "after", "test")
        \stopluacode

        \starttext
            One \footnote{Two} \insert123{Three} Four.
        \stoptext

    In MkIV I get:

        <node   1048 <   1842 >   1917 : ins 132>={
         ["attr"]="<list>",
         ["cost"]=0,
         ["depth"]=221327,
         ["head"]="<list>",
         ["height"]=790454,
         ["next"]="<node   1848 <   1917 >    nil : ins 123>",
         ["prev"]="<node   1989 <   1048 >   1842 : hlist 1>",
         ["subtype"]=132,
         ["type"]="ins",
        }
        132
        <node   1848 <   1917 >    nil : ins 123>={
         ["attr"]="<list>",
         ["cost"]=0,
         ["depth"]=1073741823,
         ["head"]="<list>",
         ["height"]=553344,
         ["prev"]="<node   1074 <   1848 >   1923 : glue 13>",
         ["subtype"]=123,
         ["type"]="ins",
        }
        123

    but in MkXL I get:

        <node :   3370 <=   3238 =>   3385 : insert 0>={
         ["attr"]="<attribute>",
         ["depth"]=221327,
         ["height"]=790454,
         ["id"]="insert",
         ["list"]="<node :    nil <=   2573 =>    nil : hlist line>",
         ["next"]="<node>",
        }
        0
        <node :   3238 <=   3385 =>    nil : insert 0>={
         ["attr"]="<attribute>",
         ["height"]=553344,
         ["id"]="insert",
         ["list"]="<node :    nil <=   3223 =>    nil : hlist line>",
        }
        0

    Is there any way to get an insert's class from its node in MkXL?

Please let me know if you have any ideas for this or any of the earlier 
questions.

Thanks!
-- Max


More information about the ntg-context mailing list