[NTG-context] How to define a command...

Wolfgang Schuster schuster.wolfgang at googlemail.com
Thu Jan 5 21:18:23 CET 2012


Am 05.01.2012 um 21:17 schrieb Peter Münster:

> On Thu, Jan 05 2012, Otared Kavian wrote:
> 
>> \define[3]\RandomCoeff{%
>> 	\ctxlua{a = math.random(#2,#3)}
>> %	\csname{Coeff#1}\endcsname{\ctxlua{tex.print(a)}} %% this line does not work as expected...
> 
> \setuprandomize[2012]
> \define[3]\RandomCoeff{%
>  \expandafter\def\csname Coeff#1\endcsname{\ctxlua{tex.print(math.random(#2,#3))}}}

\setvalue{Coeff#1}{…}

Wolfgang


More information about the ntg-context mailing list