ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Counters again
Date: Tue, 17 Jan 2012 19:10:54 +0100	[thread overview]
Message-ID: <198D4974-4EE4-4057-90B0-1C6A2C1CEE2B@googlemail.com> (raw)
In-Reply-To: <CAK5aKC_W6h9jkb+1-Q+-BK7j57qOWvtKNmsnhZW0nRQ8XLjMaA@mail.gmail.com>


Am 17.01.2012 um 15:55 schrieb Felix Ingram:

> Hello all,
> 
> 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]

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
___________________________________________________________________________________


  reply	other threads:[~2012-01-17 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 14:55 Felix Ingram
2012-01-17 18:10 ` Wolfgang Schuster [this message]
2012-01-18 13:08   ` Felix Ingram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=198D4974-4EE4-4057-90B0-1C6A2C1CEE2B@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).