* \recurselevel inside \bTABLE\eTABLE @ 2013-03-17 12:00 Willi Egger 2013-03-17 12:21 ` Alan BRASLAU 2013-03-17 21:17 ` Wolfgang Schuster 0 siblings, 2 replies; 10+ messages in thread From: Willi Egger @ 2013-03-17 12:00 UTC (permalink / raw) To: NTG-Context ConTeXt users Dear all, I should prepare a form with a table. The table rows should be numbered. How can I get get this done by using \recurselevel. In the attached minimal example all rows are numbered with 0. \starttext \subject{bTABLE--eTABLE: recurse creates rows} \bTABLE \dorecurse{3} {\bTR \bTD \recurselevel \eTD \eTR} \eTABLE What do i do wrongly here? knd regards Willi ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \recurselevel inside \bTABLE\eTABLE 2013-03-17 12:00 \recurselevel inside \bTABLE\eTABLE Willi Egger @ 2013-03-17 12:21 ` Alan BRASLAU 2013-03-17 21:17 ` Wolfgang Schuster 1 sibling, 0 replies; 10+ messages in thread From: Alan BRASLAU @ 2013-03-17 12:21 UTC (permalink / raw) To: ntg-context On Sun, 17 Mar 2013 13:00:22 +0100 Willi Egger <context@boede.nl> wrote: > Dear all, > > I should prepare a form with a table. The table rows should be > numbered. > > How can I get get this done by using \recurselevel. > In the attached minimal example all rows are numbered with 0. > > \starttext > \subject{bTABLE--eTABLE: recurse creates rows} > \bTABLE > \dorecurse{3} > {\bTR > \bTD \recurselevel \eTD > \eTR} > \eTABLE > > > What do i do wrongly here? \starttext \subject{bTABLE--eTABLE: recurse creates rows} \bTABLE \dorecurse{3} {\bTR \bTD #1 \eTD \eTR} \eTABLE \stoptext Alan ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \recurselevel inside \bTABLE\eTABLE 2013-03-17 12:00 \recurselevel inside \bTABLE\eTABLE Willi Egger 2013-03-17 12:21 ` Alan BRASLAU @ 2013-03-17 21:17 ` Wolfgang Schuster 2013-03-17 21:38 ` Aditya Mahajan 2013-03-17 22:15 ` Wolfgang Schuster 1 sibling, 2 replies; 10+ messages in thread From: Wolfgang Schuster @ 2013-03-17 21:17 UTC (permalink / raw) To: mailing list for ConTeXt users Am 17.03.2013 um 13:00 schrieb Willi Egger <context@boede.nl>: > Dear all, > > I should prepare a form with a table. The table rows should be numbered. > > How can I get get this done by using \recurselevel. > In the attached minimal example all rows are numbered with 0. > > \starttext > \subject{bTABLE--eTABLE: recurse creates rows} > \bTABLE > \dorecurse{3} > {\bTR > \bTD \recurselevel \eTD > \eTR} > \eTABLE > > What do i do wrongly here? You’re doing nothing wrong but you have to expand the value of the counter. One feature of natural tables is the calculated width of the cells, to do this context stores the content of all cells in a token register, i.e. context stores \recurselevel as content of the cell and not the value of the iteration. This content is processed after all cells have been stored and the \recurselevel macro uses at this moment its default value 0. To expand the value of the counter use \expanded{…} to force a expansion. \bTABLE \dorecurse{3}{\bTR\bTD\recurselevel\eTD\eTR} \eTABLE 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \recurselevel inside \bTABLE\eTABLE 2013-03-17 21:17 ` Wolfgang Schuster @ 2013-03-17 21:38 ` Aditya Mahajan 2013-03-17 21:49 ` Willi Egger 2013-03-17 21:52 ` Hans Hagen 2013-03-17 22:15 ` Wolfgang Schuster 1 sibling, 2 replies; 10+ messages in thread From: Aditya Mahajan @ 2013-03-17 21:38 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1: Type: TEXT/PLAIN, Size: 1353 bytes --] On Sun, 17 Mar 2013, Wolfgang Schuster wrote: > > Am 17.03.2013 um 13:00 schrieb Willi Egger <context@boede.nl>: > >> Dear all, >> >> I should prepare a form with a table. The table rows should be numbered. >> >> How can I get get this done by using \recurselevel. >> In the attached minimal example all rows are numbered with 0. >> >> \starttext >> \subject{bTABLE--eTABLE: recurse creates rows} >> \bTABLE >> \dorecurse{3} >> {\bTR >> \bTD \recurselevel \eTD >> \eTR} >> \eTABLE >> >> What do i do wrongly here? > > You’re doing nothing wrong but you have to expand the value of the counter. > > One feature of natural tables is the calculated width of the cells, to do this context stores > the content of all cells in a token register, i.e. context stores \recurselevel as content > of the cell and not the value of the iteration. This content is processed after all cells > have been stored and the \recurselevel macro uses at this moment its default value 0. > > To expand the value of the counter use \expanded{…} to force a expansion. > > \bTABLE > \dorecurse{3}{\bTR\bTD\recurselevel\eTD\eTR} > \eTABLE There was a long discussion on this a couple of years back. Summarized here: http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/ Aditya [-- Attachment #2: Type: text/plain, Size: 485 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \recurselevel inside \bTABLE\eTABLE 2013-03-17 21:38 ` Aditya Mahajan @ 2013-03-17 21:49 ` Willi Egger 2013-03-17 21:52 ` Hans Hagen 1 sibling, 0 replies; 10+ messages in thread From: Willi Egger @ 2013-03-17 21:49 UTC (permalink / raw) To: mailing list for ConTeXt users Thank you all! I was trying to find your info Adytia, but failed :-) Willi On Mar 17, 2013, at 10:38 PM, Aditya Mahajan wrote: > On Sun, 17 Mar 2013, Wolfgang Schuster wrote: > >> >> Am 17.03.2013 um 13:00 schrieb Willi Egger <context@boede.nl>: >> >>> Dear all, >>> >>> I should prepare a form with a table. The table rows should be numbered. >>> >>> How can I get get this done by using \recurselevel. >>> In the attached minimal example all rows are numbered with 0. >>> >>> \starttext >>> \subject{bTABLE--eTABLE: recurse creates rows} >>> \bTABLE >>> \dorecurse{3} >>> {\bTR >>> \bTD \recurselevel \eTD >>> \eTR} >>> \eTABLE >>> >>> What do i do wrongly here? >> >> You’re doing nothing wrong but you have to expand the value of the counter. >> >> One feature of natural tables is the calculated width of the cells, to do this context stores >> the content of all cells in a token register, i.e. context stores \recurselevel as content >> of the cell and not the value of the iteration. This content is processed after all cells >> have been stored and the \recurselevel macro uses at this moment its default value 0. >> >> To expand the value of the counter use \expanded{…} to force a expansion. >> >> \bTABLE >> \dorecurse{3}{\bTR\bTD\recurselevel\eTD\eTR} >> \eTABLE > > There was a long discussion on this a couple of years back. Summarized here: > > http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/ > > Aditya___________________________________________________________________________________ > 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \recurselevel inside \bTABLE\eTABLE 2013-03-17 21:38 ` Aditya Mahajan 2013-03-17 21:49 ` Willi Egger @ 2013-03-17 21:52 ` Hans Hagen 2013-03-17 21:58 ` Willi Egger 1 sibling, 1 reply; 10+ messages in thread From: Hans Hagen @ 2013-03-17 21:52 UTC (permalink / raw) To: mailing list for ConTeXt users On 3/17/2013 10:38 PM, Aditya Mahajan wrote: > On Sun, 17 Mar 2013, Wolfgang Schuster wrote: > >> >> Am 17.03.2013 um 13:00 schrieb Willi Egger <context@boede.nl>: >> >>> Dear all, >>> >>> I should prepare a form with a table. The table rows should be numbered. >>> >>> How can I get get this done by using \recurselevel. >>> In the attached minimal example all rows are numbered with 0. >>> >>> \starttext >>> \subject{bTABLE--eTABLE: recurse creates rows} >>> \bTABLE >>> \dorecurse{3} >>> {\bTR >>> \bTD \recurselevel \eTD >>> \eTR} >>> \eTABLE >>> >>> What do i do wrongly here? >> >> You’re doing nothing wrong but you have to expand the value of the >> counter. >> >> One feature of natural tables is the calculated width of the cells, to >> do this context stores >> the content of all cells in a token register, i.e. context stores >> \recurselevel as content >> of the cell and not the value of the iteration. This content is >> processed after all cells >> have been stored and the \recurselevel macro uses at this moment its >> default value 0. >> >> To expand the value of the counter use \expanded{…} to force a expansion. >> >> \bTABLE >> \dorecurse{3}{\bTR\bTD\recurselevel\eTD\eTR} >> \eTABLE > > There was a long discussion on this a couple of years back. Summarized > here: > > http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/ or \startluacode context.bTABLE() context.bTR() context.bTD() context.mathematics("(+)") context.eTD() for y = 1,6 do context.bTD() context(y) context.eTD() end context.eTR() for x = 1,6 do context.bTR() context.bTD() context(x) context.eTD() for y = 1,6 do context.bTD() context(x+y) context.eTD() end context.eTR() end context.eTABLE() \stopluacode ----------------------------------------------------------------- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \recurselevel inside \bTABLE\eTABLE 2013-03-17 21:52 ` Hans Hagen @ 2013-03-17 21:58 ` Willi Egger 2013-03-19 7:23 ` Wolfgang Schuster 0 siblings, 1 reply; 10+ messages in thread From: Willi Egger @ 2013-03-17 21:58 UTC (permalink / raw) To: mailing list for ConTeXt users Thank you again! Sorry for misspelling your name Aditya! I was surprised, that the solution of Wolfgang does not work, with \expanded{\recurselevel}, though it sounds reasonable. Still all rows are marked 0. Alan's suggestion gives me the desired result. Hm, I was not yet thinking about using cld... Thank you Hans! Willi On Mar 17, 2013, at 10:52 PM, Hans Hagen wrote: > On 3/17/2013 10:38 PM, Aditya Mahajan wrote: >> On Sun, 17 Mar 2013, Wolfgang Schuster wrote: >> >>> >>> Am 17.03.2013 um 13:00 schrieb Willi Egger <context@boede.nl>: >>> >>>> Dear all, >>>> >>>> I should prepare a form with a table. The table rows should be numbered. >>>> >>>> How can I get get this done by using \recurselevel. >>>> In the attached minimal example all rows are numbered with 0. >>>> >>>> \starttext >>>> \subject{bTABLE--eTABLE: recurse creates rows} >>>> \bTABLE >>>> \dorecurse{3} >>>> {\bTR >>>> \bTD \recurselevel \eTD >>>> \eTR} >>>> \eTABLE >>>> >>>> What do i do wrongly here? >>> >>> You’re doing nothing wrong but you have to expand the value of the >>> counter. >>> >>> One feature of natural tables is the calculated width of the cells, to >>> do this context stores >>> the content of all cells in a token register, i.e. context stores >>> \recurselevel as content >>> of the cell and not the value of the iteration. This content is >>> processed after all cells >>> have been stored and the \recurselevel macro uses at this moment its >>> default value 0. >>> >>> To expand the value of the counter use \expanded{…} to force a expansion. >>> >>> \bTABLE >>> \dorecurse{3}{\bTR\bTD\recurselevel\eTD\eTR} >>> \eTABLE >> >> There was a long discussion on this a couple of years back. Summarized >> here: >> >> http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/ > > or > > \startluacode > context.bTABLE() > context.bTR() > context.bTD() > context.mathematics("(+)") > context.eTD() > for y = 1,6 do > context.bTD() > context(y) > context.eTD() > end > context.eTR() > for x = 1,6 do > context.bTR() > context.bTD() > context(x) > context.eTD() > for y = 1,6 do > context.bTD() > context(x+y) > context.eTD() > end > context.eTR() > end > context.eTABLE() > \stopluacode > > > ----------------------------------------------------------------- > 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 > ___________________________________________________________________________________ ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \recurselevel inside \bTABLE\eTABLE 2013-03-17 21:58 ` Willi Egger @ 2013-03-19 7:23 ` Wolfgang Schuster 2013-03-22 21:12 ` Willi Egger 0 siblings, 1 reply; 10+ messages in thread From: Wolfgang Schuster @ 2013-03-19 7:23 UTC (permalink / raw) To: mailing list for ConTeXt users Am 17.03.2013 um 22:58 schrieb Willi Egger <context@boede.nl>: > Thank you again! > > Sorry for misspelling your name Aditya! > > I was surprised, that the solution of Wolfgang does not work, with \expanded{\recurselevel}, though it sounds reasonable. Still all rows are marked 0. Alan's suggestion gives me the desired result. See my change, you have to put \expanded before \bTD because when you write \bTD \expanded{\recurselevel} \eTD context will store “\expanded{\recurselevel}” which is expanded after all cells are created and \recurselevel has its default value. 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \recurselevel inside \bTABLE\eTABLE 2013-03-19 7:23 ` Wolfgang Schuster @ 2013-03-22 21:12 ` Willi Egger 0 siblings, 0 replies; 10+ messages in thread From: Willi Egger @ 2013-03-22 21:12 UTC (permalink / raw) To: mailing list for ConTeXt users Hi Wolfgang, hm, I see, that I did not read your first message correctly. Thank you for pointing me to it! Willi On Mar 19, 2013, at 8:23 AM, Wolfgang Schuster wrote: > > Am 17.03.2013 um 22:58 schrieb Willi Egger <context@boede.nl>: > >> Thank you again! >> >> Sorry for misspelling your name Aditya! >> >> I was surprised, that the solution of Wolfgang does not work, with \expanded{\recurselevel}, though it sounds reasonable. Still all rows are marked 0. Alan's suggestion gives me the desired result. > > See my change, you have to put \expanded before \bTD because when you write > > \bTD \expanded{\recurselevel} \eTD > > context will store “\expanded{\recurselevel}” which is expanded > after all cells are created and \recurselevel has its default value. > > 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: \recurselevel inside \bTABLE\eTABLE 2013-03-17 21:17 ` Wolfgang Schuster 2013-03-17 21:38 ` Aditya Mahajan @ 2013-03-17 22:15 ` Wolfgang Schuster 1 sibling, 0 replies; 10+ messages in thread From: Wolfgang Schuster @ 2013-03-17 22:15 UTC (permalink / raw) To: mailing list for ConTeXt users Am 17.03.2013 um 22:17 schrieb Wolfgang Schuster <schuster.wolfgang@gmail.com>: > > Am 17.03.2013 um 13:00 schrieb Willi Egger <context@boede.nl>: > >> Dear all, >> >> I should prepare a form with a table. The table rows should be numbered. >> >> How can I get get this done by using \recurselevel. >> In the attached minimal example all rows are numbered with 0. >> >> \starttext >> \subject{bTABLE--eTABLE: recurse creates rows} >> \bTABLE >> \dorecurse{3} >> {\bTR >> \bTD \recurselevel \eTD >> \eTR} >> \eTABLE >> >> What do i do wrongly here? > > You’re doing nothing wrong but you have to expand the value of the counter. > > One feature of natural tables is the calculated width of the cells, to do this context stores > the content of all cells in a token register, i.e. context stores \recurselevel as content > of the cell and not the value of the iteration. This content is processed after all cells > have been stored and the \recurselevel macro uses at this moment its default value 0. > > To expand the value of the counter use \expanded{…} to force a expansion. > > \bTABLE > \dorecurse{3}{\bTR\bTD\recurselevel\eTD\eTR} > \eTABLE Needs \expanded: \bTABLE \dorecurse{3}{\bTR\expanded{\bTD\recurselevel\eTD}\eTR} \eTABLE 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-03-22 21:12 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-03-17 12:00 \recurselevel inside \bTABLE\eTABLE Willi Egger 2013-03-17 12:21 ` Alan BRASLAU 2013-03-17 21:17 ` Wolfgang Schuster 2013-03-17 21:38 ` Aditya Mahajan 2013-03-17 21:49 ` Willi Egger 2013-03-17 21:52 ` Hans Hagen 2013-03-17 21:58 ` Willi Egger 2013-03-19 7:23 ` Wolfgang Schuster 2013-03-22 21:12 ` Willi Egger 2013-03-17 22:15 ` Wolfgang Schuster
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).