[NTG-context] \define[1]\command or \define\command[1]? (was: math: command for absolute value: `\define\abs[1]{\lvert #1 \rvert}` throws `\lvert -\Udelimiter`.)

2011-06-05 Thread Paul Menzel
Dear Otared,


Am Samstag, den 04.06.2011, 23:59 +0200 schrieb Otared Kavian:

 I think the error comes from your way of using \define: you use
\define\abs[1]{\lvert #1 \rvert}
 instead of
   \define[1]\abs{\lvert#1\rvert}
 
  the following works fine for me:
 
 \starttext
 
 %\define[1]\abs{|#1|} % this works
 
 \define[1]\abs{\lvert#1\rvert} % this works too
 
 $\abs{-1} = 1$
 \stoptext

thank you very much for the solution. I took my definition from the Wiki
[1].

Could the developers please clarify the correct syntax so that it can be
updated in the source or the Wiki.


Thanks,

Paul


[1] http://wiki.contextgarden.net/Reference/en/define


signature.asc
Description: This is a digitally signed message part
___
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
___

Re: [NTG-context] \define[1]\command or \define\command[1]? (was: math: command for absolute value: `\define\abs[1]{\lvert #1 \rvert}` throws `\lvert -\Udelimiter`.)

2011-06-05 Thread Wolfgang Schuster

Am 05.06.2011 um 12:11 schrieb Paul Menzel:

 thank you very much for the solution. I took my definition from the Wiki [1].
 
 Could the developers please clarify the correct syntax so that it can be
 updated in the source or the Wiki.


The wiki entry is correct, the syntax is

  \define[number of arguments]\name of the command{do something with the 
arguments}


When you want a command without argument you can omit the brackets and write

  \define\command{...}


Wolfgang

___
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
___