On 2012-09-04 Aditya Mahajan
Instead of
context(tex.toks.mytoks)
use
context(function () context(tex.toks.mytoks) end)
See the ConTeXt Lua Document manual for explanation.
Thanks. This works indeed. But what to do in the following case? It's hard to find a proper wording for this problem which makes searching on the net or in the documentation difficult. \starttext \def\cmd {\newdimen\mydimen \mydimen=50pt} \startluacode context.cmd() if tex.dimen.mydimen < tex.dimen.textwidth then context("is smaller") else context("is not smaller") end \stopluacode \stoptext
Is there a way to access the contents of the macro from within Lua like counters and token registers?
[…]
AFAIK, this is not possible.
Thanks. Marco