[NTG-context] how to simulate \hss in luametatex?

黄复雄 aahuaang at gmail.com
Fri Nov 11 03:37:32 CET 2022

Hi list,
I want to  simulate \hss  in lua end in ConTeXt/luametatex environment.
For example,

a{\raise 1.5ex\hbox to 0pt{\hss b}}c

should get 'b' on top of 'a', as follows:

and in lua, I see a <glue userskip> before "b" node, width
width:0, stretch:65536, shrink:65536, stretchorder:2, shrinkorder:2

And in lua, I do as follows(part of my app seen in attachment):

    local hss = node_new(glue_id)
    hss.stretch = 65536
    hss.stretchorder = 2
    hss.shrink = 65536
    hss.shrinkorder = 2
    hss.width = 0
    list,_ = node_insertbefore(list, list, hss)  -- b is in the list
    -- I got a <glue userskip> with
    width:0, stretch:65536, shrink:65536, stretchorder:2, shrinkorder:2

    local box = node_new(hlist_id, "box")
    box.head = list
    box.width = 0
    box.shift = -tex_sp("1ex")
    -- I got <hlist box>  width:0       height:0       deep:0
shift: -503424

    head, current = node_insertbefore(head,current, box)  -- current is 'c' node

And got 'b' on top of 'c' in pdf as follows:


How can I get 'b' on top of 'a' as \hss do?

If your question is of interest to others as well, please add an entry
to the Wiki!

maillist : ntg-context at ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t-zhpunc.lua
Type: application/octet-stream
Size: 22250 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20221111/88cdba47/attachment-0001.obj>

More information about the ntg-context mailing list