From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38887 Path: news.gmane.org!not-for-mail From: "Bart C. Wise" Newsgroups: gmane.comp.tex.context Subject: Re: Numbers in Tables Date: Wed, 30 Jan 2008 07:33:15 -0700 Message-ID: <200801300733.16569.bart@wiseguysweb.com> References: <200801291212.05878.bntgcontext@wiseguysweb.com> <47A07064.2070807@gmx.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1201765080 10080 80.91.229.12 (31 Jan 2008 07:38:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2008 07:38:00 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 31 08:38:19 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1JKU03-0003Zy-Is for gctc-ntg-context-518@m.gmane.org; Thu, 31 Jan 2008 08:38:19 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2A92F1FB60; Thu, 31 Jan 2008 08:37:52 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 32227-06-5; Thu, 31 Jan 2008 08:37:12 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EB8851FB71; Thu, 31 Jan 2008 08:37:10 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 54B4C1FB82 for ; Wed, 30 Jan 2008 15:34:02 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 24959-05-20 for ; Wed, 30 Jan 2008 15:33:26 +0100 (CET) Original-Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by ronja.ntg.nl (Postfix) with ESMTP id 8BF811FB4E for ; Wed, 30 Jan 2008 15:33:25 +0100 (CET) Original-Received: from [166.70.13.201] (helo=mgr1.xmission.com) by out01.mta.xmission.com with esmtp (Exim 4.62) (envelope-from ) id 1JKE0E-0007iQ-Bk for ntg-context@ntg.nl; Wed, 30 Jan 2008 07:33:26 -0700 Original-Received: from bwise1.provo.novell.com ([137.65.171.141] helo=bwise1) by mgr1.xmission.com with esmtpa (Exim 4.50) id 1JKE0B-0000LW-4T for ntg-context@ntg.nl; Wed, 30 Jan 2008 07:33:24 -0700 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) In-Reply-To: <47A07064.2070807@gmx.net> Content-Disposition: inline Received-SPF: none (mgr1.xmission.com: 137.65.171.141 is neither permitted nor denied by domain of wiseguysweb.com) client-ip=137.65.171.141; envelope-from=bart@wiseguysweb.com; helo=bwise1; X-SA-Exim-Connect-IP: 137.65.171.141 X-SA-Exim-Mail-From: bart@wiseguysweb.com X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100) X-SA-Exim-Scanned: Yes (on mgr1.xmission.com) X-Virus-Scanned: amavisd-new at ntg.nl X-Mailman-Approved-At: Thu, 31 Jan 2008 08:37:08 +0100 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:38887 Archived-At: Peter, Thanks for you input. It works great and it would have take me forever to figure that one out! Thanks, Bart On Wednesday January 30 2008, Peter Rolf wrote: > Bart Wise schrieb: > > The code below defines a number and then on each row, displays then > > increments the number. The number is defined and reset to 0 before the > > table is declared. However, when the number is displayed in the table, > > it's not zero as expected, but some other number (usually between 3 and > > 9). The reset at reset point #1 does reset the number to 0, but it > > doesn't stay that way when the table is declared. The only thing I have > > found to work, is to define a row and column and put the reset there (see > > reset point #2). > > > > I would like to declare and reset the number outside of the table > > definition, but it doesn't seem to work. What am I doing wrong? > > the table is passed several times to get the size maxima, etc. > your number is also incremented in every pass (how many passes?). ;) > > use something like this to take care of trial typesetting: > > > \definenumber[MyNum] > > \def\IncrTABLEnum[#1]% > {\iftrialtypesetting > \hbox{00}% allocate some space in the first pass > \else > \getnumber[#1]\incrementnumber[#1]% > \fi} > > \starttext > > \resetnumber[MyNum] % reset point #1 > \bTABLE > % \bTR\bTD \resetnumber[MyNum] \eTD\eTR % reset point #2 > \bTR\bTD \IncrTABLEnum[MyNum] \eTD\eTR > \bTR\bTD \IncrTABLEnum[MyNum] \eTD\eTR > \bTR\bTD \IncrTABLEnum[MyNum] \eTD\eTR > \bTR\bTD \IncrTABLEnum[MyNum] \eTD\eTR > \eTABLE > > \stoptext > > > best, peter > > > \definenumber[MyNum] > > > > \starttext > > \resetnumber[MyNum] % reset point #1 > > \bTABLE > > % \bTR\bTD \resetnumber[MyNum] \eTD\eTR % reset point #2 > > \bTR\bTD \getnumber[MyNum]\incrementnumber[MyNum] \eTD\eTR > > \bTR\bTD \getnumber[MyNum]\incrementnumber[MyNum] \eTD\eTR > > \bTR\bTD \getnumber[MyNum]\incrementnumber[MyNum] \eTD\eTR > > \bTR\bTD \getnumber[MyNum]\incrementnumber[MyNum] \eTD\eTR > > \eTABLE > > \stoptext > > _________________________________________________________________________ > >__________ 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 : https://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 : https://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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________