On 12-7-2011 5:30, Jaroslav Hajtmar wrote:
But someone advised me that I use the better syntax:
context('\\def\\Mymacro\{arg of mymacro\}')
or context("\\def\\test#1{#1}") etc...
whatever you like best
context.setvalue{"Mymacro",somevalue)
context([[\def\MyMacro#1{#1}]])
Exist other (best or most optimal) way to do?
for i = 1, 10 do
tex.sprint(tex.ctxcatcodes,'\\def\\macro'..ar2rom(i)..'\{macro '..i..'\}')
context('\\def\\Macro'..ar2rom(i)..'\{Macro '..i..'\}')
end
for i = 1, 10 do
context([[\def\Macro%s{Macro%s}]],ar2rom(i),i)
end
When more than one argument is given, the context command treats the
first argument as format template.
By using the context command you can see what happens with
\enabletrackers[context.trace]
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________