From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38862 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: Numbers in Tables Date: Wed, 30 Jan 2008 13:41:08 +0100 Message-ID: <47A07064.2070807@gmx.net> References: <200801291212.05878.bntgcontext@wiseguysweb.com> 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 1201696903 17153 80.91.229.12 (30 Jan 2008 12:41:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jan 2008 12:41:43 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 30 13:42:02 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 1JKCGP-00035W-VK for gctc-ntg-context-518@m.gmane.org; Wed, 30 Jan 2008 13:42:02 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1A0C71FB57; Wed, 30 Jan 2008 13:41:33 +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 30358-03; Wed, 30 Jan 2008 13:41:18 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C53291FB30; Wed, 30 Jan 2008 13:41:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 15BC91FB30 for ; Wed, 30 Jan 2008 13:41:15 +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 05221-01-2 for ; Wed, 30 Jan 2008 13:41:10 +0100 (CET) Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by ronja.ntg.nl (Postfix) with SMTP id 4DF561FB29 for ; Wed, 30 Jan 2008 13:41:10 +0100 (CET) Original-Received: (qmail invoked by alias); 30 Jan 2008 12:41:09 -0000 Original-Received: from i5387D49E.versanet.de (EHLO [192.168.1.3]) [83.135.212.158] by mail.gmx.net (mp048) with SMTP; 30 Jan 2008 13:41:09 +0100 X-Authenticated: #24293357 X-Provags-ID: V01U2FsdGVkX19Ow8hKSMtOf52pJzYrSsQx6yVhSXUFRoA/fEjEnI +Y3Gi7BqDircMo User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: <200801291212.05878.bntgcontext@wiseguysweb.com> X-Enigmail-Version: 0.95.6 X-Y-GMX-Trusted: 0 X-Virus-Scanned: amavisd-new at ntg.nl 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:38862 Archived-At: 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 ___________________________________________________________________________________