Hi all,

I would like to write a macro which may have sometimes two, sometimes three 
arguments. The first and the last one are always present, but not necessarily 
the middle one. The unsatisfactory solution I have now is something like the 
example below:

\define[2]\myMacroTwo{Name: #1\crlf Email: #2\crlf\thinrule\blank[small]}
\define[3]\myMacroThree{Name: #1\crlf Address: #2 \crlf Email: 
#3\crlf\thinrule\blank[small]}

\starttext
\mymacrotwo{hans}{h...@hagen.context.nl}
\myMacroThree{Wolfgang}{Paradise of TeX, 2010}{wolfg...@schuster.context.de}
\stoptext

I think that (or rather I am certain…) in ConTeXt it is possible to define a 
unique macro called \myMacro which automatically tests the number of arguments: 
if there are  only two of them the commands in \myMacroTwo are executed, while 
if three arguments are present, the commands in \myMacroThree are executed.

Can anyone give a hint on this matter? 
___________________________________________________________________________________
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