Perhaps you might want to do something processing a comma separated
list:
http://wiki.contextgarden.net/System_Macros/Comma_Separated_Lists
Alan
On Wed, 11 Dec 2013 00:29:07 +0900
Pavel Stupin
..Alas, I was too hasty to congratulate myself as it obviously doesn't work as intended (the arguments in the nested function get hard-coded and are of no use). :) So I'm still looking forward for ConTeXt masters to enlighten me.
Kind regards, Pavel.
2013/12/11 Pavel Stupin
: To answer my own question. I think I've solved the problem by splitting a macros into several ones and then nesting them into each opther. A sort of a clumsy solution but it works. Kind regards, Pavel.
2013/12/10 Pavel Stupin
: Thank you, Wolfgang! Much to my delight, \startembeddedxtable works indeed, however, when I increase the number of arguments up to 10 --- to use the simplest example possible, without any tables: \define[10]\myText{#1 #2 #3 #4 #5 #6 #7 #8 #9 #10} --- it doesn't work again (works fine with 9 arguments). Am I correct assuming that there's an inherent limitation to 9 arguments only or the 2+-digit numbers should be written somehow differently? Is there any workaround?
Kind regards, Pavel.
2013/12/10 Wolfgang Schuster
: Am 10.12.2013 um 12:23 schrieb Pavel Stupin
: Hello:
I'm struggling with understanding the way \define is supposed to work. I would like to have a macros to generate tables and populate them with some specific data submitted as arguments. I apologize for my lack of understanding of the very basics, but e.g. the following code just doesn't compile:
\define[1]\mytable{ \startxtable \startxrow \startxcell #1 \stopxcell \stopxrow \stopxtable}
\mytable{abc}
I would appreciate your help and maybe some references to read (if any) in order to educate myself.
The problem in your example isn’t define but the stable which uses a buffer to collect the content and buffers and be used in \def or \define commands.
What you can do in this case is to replace \startxtable with \startembeddedxtable and change your code to
\dfeine[1]\mytable {\startembeddedxtable \startxrow \startxcell#1\stopxcell \stopxrow \stopembeddedxtable}
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 ___________________________________________________________________________________
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 ___________________________________________________________________________________
-- Alan Braslau CEA DSM-IRAMIS-SPEC CNRS URA 2464 Orme des Merisiers 91191 Gif-sur-Yvette cedex FRANCE tel: +33 1 69 08 73 15 fax: +33 1 69 08 87 86 mailto:alan.braslau@cea.fr