[NTG-context] \e!start in lua

Wolfgang Schuster schuster.wolfgang at googlemail.com
Sun Jan 16 09:52:31 CET 2011


Am 15.01.2011 um 23:57 schrieb Aditya Mahajan:

> What is the best way to define the equivalent of
> 
>    \setvalue{\e!start\NAME}{...}
> 
> in lua.
> 
>    e_start = ??
>    context.setvalue(e_start .. name, "...")

\startluacode
context.setvalue("foo","\\framedtext")
context.setvalue(table.concat({"start","foo"}),"\\startframedtext")
context.setvalue(table.concat({"stop" ,"foo"}),"\\stopframedtext" )
\stopluacode

\starttext
\foo{foo}
\startfoo bar\stopfoo
\stoptext

You can also write “context.setvalue("start".."foo","…")” but table.concat
looks better but the question is why don’t you use just tex
to create the start/stop commands.

Wolfgang



More information about the ntg-context mailing list