From: Aditya Mahajan <adityam@umich.edu>
To: news3@nililand.de, mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Skipping item numbers in an itemized list?
Date: Wed, 27 Apr 2011 11:21:31 -0400 (EDT) [thread overview]
Message-ID: <alpine.LNX.2.01.1104271110590.19655@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <j353sbvj1evn$.dlg@nililand.de>
On Wed, 27 Apr 2011, Ulrike Fischer wrote:
> Am Wed, 27 Apr 2011 16:19:45 +0200 schrieb Wolfgang Schuster:
>
>> Am 27.04.2011 um 15:53 schrieb Alasdair McAndrew:
>>
>>> Hello,
>>>
>>> The effect I want is something like:
>>>
>>> 1. First item
>>> 2. Second item
>>> 5. Fifth item
>>> 6. Sixth item
>>> 8. Eight item
>
>>> and so on. Every now and then I need to skip a number or two.
>>> In LaTeX I could do this with \addtocounter{enumi}{2} - but how
>>> is this done in ConTeXt?
>
>> \starttext
>>
>> \startitemize
>> \sym{1.} First item
>> \sym{2.} Second item
>> \sym{5.} Fifth item
>> \sym{6.} Sixth item
>> \sym{8.} Eight item
>> \stopitemize
>>
>> \stoptext
>
> You can't be serious ;-). Do you really think one should enter all
> numbers manually only because someone wants to skip e.g. the number
> "13"?
You can't be serious ;) Do you really think that one should manually
increment a counter. What's next: using {\bfa Some title} for section
titles?
More seriously, if there is a logic behind such a counter, then you can
use:
\defineconversion[fancy][1,2,5,6,8]
% or a TeX or Lua command that generates the count
\startitemize[fancy] ....
> There must be a counter around and a way to advance it.
If you insist,
\setstructurecounter[\currentitemgroupcounter]{5}
There is no interface to increment the counter by arbitrary amount, but
you can define your own interface to structures.counters.add:
\unprotected
\def\addtostructurecounter [#1]#2{\ctxlua{structures.counters.add
("\@@thestructurecounter{#1}",1,#2)}}
and then use
\addtostructurecounter[\currentitemgroupcounter]{2}
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
___________________________________________________________________________________
next prev parent reply other threads:[~2011-04-27 15:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 13:53 Alasdair McAndrew
2011-04-27 14:19 ` Wolfgang Schuster
2011-04-27 14:39 ` Ulrike Fischer
2011-04-27 14:45 ` Andreas Harder
2011-04-27 15:21 ` Aditya Mahajan [this message]
2011-04-27 17:33 ` Ulrike Fischer
2011-04-28 3:47 ` Alasdair McAndrew
2011-04-27 14:22 ` Otared Kavian
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=alpine.LNX.2.01.1104271110590.19655@ybpnyubfg.ybpnyqbznva \
--to=adityam@umich.edu \
--cc=news3@nililand.de \
--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).