From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73970 Path: news.gmane.org!not-for-mail From: Felix Ingram Newsgroups: gmane.comp.tex.context Subject: Re: Counters again Date: Wed, 18 Jan 2012 13:08:50 +0000 Message-ID: References: <198D4974-4EE4-4057-90B0-1C6A2C1CEE2B@googlemail.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: dough.gmane.org 1326892161 17391 80.91.229.12 (18 Jan 2012 13:09:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 Jan 2012 13:09:21 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 18 14:09:16 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RnVGO-00038B-1V for gctc-ntg-context-518@m.gmane.org; Wed, 18 Jan 2012 14:09:16 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 36660CB206; Wed, 18 Jan 2012 14:09:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3BlTvwQKtv1k; Wed, 18 Jan 2012 14:09:14 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 81431CB1F5; Wed, 18 Jan 2012 14:09:12 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3D5F0CB1C5 for ; Wed, 18 Jan 2012 14:09:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Uigh1tihy1el for ; Wed, 18 Jan 2012 14:08:51 +0100 (CET) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id DC54CCB1F5 for ; Wed, 18 Jan 2012 14:08:51 +0100 (CET) Original-Received: from mail-vw0-f41.google.com (mail-vw0-f41.google.com [209.85.212.41]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q0ID8omO018048 for ; Wed, 18 Jan 2012 14:08:51 +0100 Original-Received: by vbbfa15 with SMTP id fa15so3201488vbb.14 for ; Wed, 18 Jan 2012 05:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=AQa2CLIuG0ABftPT5605hK+6nNmNwQeMrsdLD80FlbA=; b=Qj3rJFnzJtVieRDbj3pZYalD35XCQ3ozGeJiSEHhTds9wYVwXUF54qUNLuPgo16HKV uvE8yw6GQznWae0YBCOFyw8f+UMB22Yb+BQJ5xPwaFaZj/0emCd5kBb91pHrssL19POM 51KcgzYHerdENwGqMr3A4A55ELNfzVQvd9c+k= Original-Received: by 10.52.172.241 with SMTP id bf17mr785500vdc.124.1326892130040; Wed, 18 Jan 2012 05:08:50 -0800 (PST) Original-Received: by 10.52.184.193 with HTTP; Wed, 18 Jan 2012 05:08:50 -0800 (PST) In-Reply-To: <198D4974-4EE4-4057-90B0-1C6A2C1CEE2B@googlemail.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.212.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0dGn18Oml - 6c701bbdbdfa - 20120118 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:73970 Archived-At: On 17 January 2012 18:10, Wolfgang Schuster wrote: > > Am 17.01.2012 um 15:55 schrieb Felix Ingram: > >> >> I'm now trying to use counters that will tally some values. The value >> of these could be zero, which the wiki states will be the default >> value. The following shows that nothing is displayed when the counter >> is 0. >> >> \definenumber[examplecounter] >> \setnumber[examplecounter]{1} >> \starttext >> This is the default value: \getnumber[examplecounter] >> \incrementnumber[examplecounter] >> This is the new value: \getnumber[examplecounter] >> \resetnumber[examplecounter] >> This is the reset value: \getnumber[examplecounter] >> \setnumber[examplecounter]{0} >> This is the set value: \getnumber[examplecounter] >> \stoptext >> >> I can include some conditionals to check this but thought I'd report >> it in case I'm doing it wrong/the wiki needs updating. > > The wiki explains often the behavior for MkII but MkIV does sometimes things different > but when you need only the value of the counter without chapter or section prefixes > you can use \rawnumber which shows also the start value. > > BTW: In the next beta the syntax for \setnumber will change, now both arguments are > written in brackets, e.g. \setnumber[mycount][4] Thanks Wolfgang - \rawnumber works as expected. I think that my approach is flawed, however. I'm letting users set a userstructurevariable that I'm tying to counters in order to produce a(nother) summary table. The problem is that the table is at the start of the document and so the counters will all be at their initial value. I'll need to find a way to save the counters over compile runs or to delay the building of the summary table until after the rest of the document is done. Felix ___________________________________________________________________________________ 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 ___________________________________________________________________________________