On 2012-09-04 Aditya Mahajan <adit...@umich.edu> wrote:

Hi Aditya,

> 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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to