Thank you, Max, for the effort and Hans for a core solution! Am 10.06.24 um 10:28 schrieb Hans Hagen via ntg-context:
Indeed we can have:
local namespace = tokens.getters.macro("??measure")
function tex.getmeasure(name,asdimen) local value = tex.getdimensionvalue(namespace..name) if asdimen then return value .. "sp" else return value end
and when you want to avoid the namespace you can do:
function tex.getmeasure(name,asdimen) local value = token.getexpansion("\\tointeger\\measured{"..name.."}") if asdimen then return value .. "sp" else return tonumber(value) end end
which is some 4 times slower. It'sindeed not documented (although there are some examples in accessors-001.tex) but it's in one of my todo's because I can use it in some places (there ar emopre such todo's) after which it will be discussed in one of the lowlelvel manuals
i'll add tex.getmeasure to the core (but a bit different)
Not to be misunderstood, I couldn’t check yet, maybe I wasn’t clear: I need to process the measure as a dimension, like \measured{Bleed}. As far as I tried, neither tex.measured nor context.measured worked (but I wouldn’t swear on it, maybe I had a different error). Hraban