How to obtain the hbox's node when there is only one hbox for an entire paragraph?
Dear list,
What is the non-hacking way to obtain the hbox's node in a Lua hook
when there is only one hbox for an entire paragraph?
Best regards,
Huang Fusyong (黄复雄)
% start ConTeXt
\startluacode
Moduledata = Moduledata or {}
Moduledata.jiazhu = Moduledata.jiazhu or {}
---[[
local function show_detail(n, label)
local l = label or "======="
print(">>>>>>>>>"..l.."<<<<<<<<<<")
print(nodes.toutf(n))
for i in node.traverse(n) do
local char
if i.id == nodes.nodecodes.glyph then
char = utf8.char(i.char)
print(i, char)
elseif i.id == nodes.nodecodes.penalty then
print(i, i.penalty)
elseif i.id == nodes.nodecodes.glue then
print(i, i.width, i.stretch, i.shrink, i.stretchorder,
i.shrinkorder)
elseif i.id == nodes.nodecodes.hlist then
print(i,
nodes.toutf(i.list),i.width,i.height,i.depth,i.shift,i.glue_set,i.glue_sign,i.glue_order)
elseif i.id == nodes.nodecodes.kern then
print(i, i.kern, i.expension)
else
print(i)
end
end
end
--]]
function Moduledata.jiazhu.main(head)
show_detail(head,"head")
return head, true
end
nodes.tasks.appendaction("processors", "after", "Moduledata.jiazhu.main")
\stopluacode
\starttext
\hbox{a b c}
% The result is as follows (without the
participants (1)
-
黄复雄