[luatex] Getting a glue node subtype on lua side

Paul Isambert zappathustra at free.fr
Mon May 23 11:43:42 CEST 2011


Le 23/05/2011 11:23, Christophe Jorssen a écrit :
> Hello all,
>
> I'd like to get a glue node subtype on lua side, ie a function that
> returns 102 for, say, xleaders. Is there something like
>
> node.id('glue')
>
> (used for node type) for node subtype ? node.subtype only works for
> whatsits, am I right ?

There is no such function, but you can do it yourself:

local glue_subtypes = {
     [0] = "skip",
     "lineskip", "baselineskip", "parskip", "abovedisplayskip", 
"belowdisplayskip",
     "abovedisplayshortskip", "belowdisplayshortskip", "leftskip", 
"rightskip", "topskip",
     "splittopskip", "tabskip", "spaceskip", "xspaceskip", 
"parfillskip", "thinmuskip",
     "medmuskip", "thickmuskip",
     [100] = "leaders",
     [101] = "cleaders",
     [102] = "xleaders",
     [103] = "gleaders"
     }

function glue_subtype (str)
     return glue_subtypes[str]
end

Of course you have to check development regularly to make sure glue 
subtypes don't change (for instance, I think there might be a 
glue-from-space-character subtype someday).

Best,
Paul


More information about the luatex mailing list