Mico Loretan <[email protected]> a écrit:
> I'm trying to create a glue node that has a specific width. Unfortunately, I
> seem to be missing something (probably entirely trivial to somebody who knows
> how it's done).
>
> Here's what I've tried so far:
>
> local glue = node.id ( "glue" ) -- 10
> local gluespec = node.id ( "glue_spec" ) -- 47
> local gluenode = node.new ( glue ) -- create the node
> gluenode.subtype = 0 -- "skip"
> -- what next??
>
> I would like to make this node have a width of 0.03em (no stretchability or
> shrinkability needed).
>
> The LuaTeX reference manual (p. 178) says that I should do something with the
> node's field called "gluenode.spec". If I understand the manual correctly,
> this field should be a "pointer to an item of type 'glue_spec'." However,
> there's no indication on how this should be done, and the explanation of
> glue_spec on pp. 173f. is even terser.
A glue node points to a glue_spec node that contains the real stuff; I
*think* that that akward interface will disappear one day and glue
nodes will contain their own information. Meanwhile:
local gluenode = node.new(node.id("glue"))
local gluespec = node.new(node.id("glue_spec"))
gluespec.width = tex.sp("0.03em")
gluenode.spec = gluespec
Best,
Paul