ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Increment an item number?
@ 2012-02-14  5:27 Alasdair McAndrew
  2012-02-14 12:39 ` Otared Kavian
  0 siblings, 1 reply; 5+ messages in thread
From: Alasdair McAndrew @ 2012-02-14  5:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 533 bytes --]

What is the ConTeXt version of the LaTeX

\addtocounter{enumi}{1} ?

I want to increment my numbering in an itemize environment, so that the
list is typeset as

1.  First item
2.  Next item
3.  Another item
5.  Yet another
6.  And so on

I'm typing out solutions to questions in some student notes, and the
missing item is a question for which a written solution is not necessary.

Thanks,
Alasdair

-- 
Blog: http://amca01.wordpress.com
Web:  http://sites.google.com/site/amca01/
Facebook: http://www.facebook.com/alasdair.mcandrew

[-- Attachment #1.2: Type: text/html, Size: 955 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Increment an item number?
  2012-02-14  5:27 Increment an item number? Alasdair McAndrew
@ 2012-02-14 12:39 ` Otared Kavian
  2012-02-14 12:48   ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Otared Kavian @ 2012-02-14 12:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1429 bytes --]

Hi Alasdair,

Maybe the following gives you what you want?

\starttext
\startitemize[n]
\item First question
\phantom{\item }
\item Third question
\phantom{\item }
\item Fifth question
\item Sixth question
\stopitemize
\stoptext

Best regards: OK

On 14 févr. 2012, at 06:27, Alasdair McAndrew wrote:

> What is the ConTeXt version of the LaTeX
> 
> \addtocounter{enumi}{1} ?
> 
> I want to increment my numbering in an itemize environment, so that the list is typeset as
> 
> 1.  First item
> 2.  Next item
> 3.  Another item
> 5.  Yet another
> 6.  And so on
> 
> I'm typing out solutions to questions in some student notes, and the missing item is a question for which a written solution is not necessary.
> 
> Thanks,
> Alasdair
> 
> -- 
> Blog: http://amca01.wordpress.com
> Web:  http://sites.google.com/site/amca01/
> Facebook: http://www.facebook.com/alasdair.mcandrew
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 2528 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Increment an item number?
  2012-02-14 12:39 ` Otared Kavian
@ 2012-02-14 12:48   ` Hans Hagen
  2012-02-14 16:27     ` Thomas A. Schmitz
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2012-02-14 12:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

On 14-2-2012 13:39, Otared Kavian wrote:
> \starttext
> \startitemize[n]
> \item First question
> \phantom{\item }
> \item Third question
> \phantom{\item }
> \item Fifth question
> \item Sixth question
> \stopitemize
> \stoptext

or something

\starttext
\startitemize[n]
\item First question
\incrementnumber[itemgroup:itemize]
\item Third question
\incrementnumber[itemgroup:itemize]
\item Fifth question
\item Sixth question
\stopitemize
\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Increment an item number?
  2012-02-14 12:48   ` Hans Hagen
@ 2012-02-14 16:27     ` Thomas A. Schmitz
  2012-02-15  0:10       ` Alasdair McAndrew
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas A. Schmitz @ 2012-02-14 16:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 2/14/12 1:48 PM, Hans Hagen wrote:
>> \starttext
>> \startitemize[n]
>> \item First question
>> \phantom{\item }
>> \item Third question
>> \phantom{\item }
>> \item Fifth question
>> \item Sixth question
>> \stopitemize
>> \stoptext
>
> or something
>
> \starttext
> \startitemize[n]
> \item First question
> \incrementnumber[itemgroup:itemize]
> \item Third question
> \incrementnumber[itemgroup:itemize]
> \item Fifth question
> \item Sixth question
> \stopitemize
> \stoptext

Just a hint: however you do it, I think this is not the best approach. 
you write:

> I'm typing out solutions to questions in some student notes, and the
missing item is a question for which a written solution is not necessary.


If this is a recurrent task, i.e. if you regularly make up student 
problems and then typeset the solutions, this approach is inefficient 
because you're doing the book keeping yourself. If, for example, you 
decide to delete one of the questions without written solution, you will 
have to delete the \incrementnumber as well. It may be better if you let 
ConTeXt do the book keeping: give every question a unique identitfier 
like so

\startitem[p:1:2]
  Problem?
\stopitem

and then typeset the solutions by referring back to this identifier:

\sym{\in[p:1:2]}

That way, the numbers in problems and solutions will always be correct, 
even if you rearrange etc. (I often typeset such exercise stylesheets, 
and after many years, that's my approach today.)

Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Increment an item number?
  2012-02-14 16:27     ` Thomas A. Schmitz
@ 2012-02-15  0:10       ` Alasdair McAndrew
  0 siblings, 0 replies; 5+ messages in thread
From: Alasdair McAndrew @ 2012-02-15  0:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2840 bytes --]

Thanks for the answers.  I did in fact know about \incrementnumber, but I
couldn't find any information about the counter.  Where would I find such
information, aside from asking on this mailgroup?

As for identifying each question and referring to it: that is an excellent
solution, but in fact I have only rarely to leave out an answer, and the
small amount of bookkeeping required is not at all onerous.

Thanks again,
Alasdair

On Wed, Feb 15, 2012 at 3:27 AM, Thomas A. Schmitz <
thomas.schmitz@uni-bonn.de> wrote:

> On 2/14/12 1:48 PM, Hans Hagen wrote:
>
>> \starttext
>>> \startitemize[n]
>>> \item First question
>>> \phantom{\item }
>>> \item Third question
>>> \phantom{\item }
>>> \item Fifth question
>>> \item Sixth question
>>> \stopitemize
>>> \stoptext
>>>
>>
>> or something
>>
>> \starttext
>> \startitemize[n]
>> \item First question
>> \incrementnumber[itemgroup:**itemize]
>> \item Third question
>> \incrementnumber[itemgroup:**itemize]
>> \item Fifth question
>> \item Sixth question
>> \stopitemize
>> \stoptext
>>
>
> Just a hint: however you do it, I think this is not the best approach. you
> write:
>
>  I'm typing out solutions to questions in some student notes, and the
>>
> missing item is a question for which a written solution is not necessary.
>
>
> If this is a recurrent task, i.e. if you regularly make up student
> problems and then typeset the solutions, this approach is inefficient
> because you're doing the book keeping yourself. If, for example, you decide
> to delete one of the questions without written solution, you will have to
> delete the \incrementnumber as well. It may be better if you let ConTeXt do
> the book keeping: give every question a unique identitfier like so
>
> \startitem[p:1:2]
>  Problem?
> \stopitem
>
> and then typeset the solutions by referring back to this identifier:
>
> \sym{\in[p:1:2]}
>
> That way, the numbers in problems and solutions will always be correct,
> even if you rearrange etc. (I often typeset such exercise stylesheets, and
> after many years, that's my approach today.)
>
> Thomas
>
> ______________________________**______________________________**
> _______________________
> 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 <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/<http://foundry.supelec.fr/projects/contextrev/>
> wiki     : http://contextgarden.net
> ______________________________**______________________________**
> _______________________
>



-- 
Blog: http://amca01.wordpress.com
Web:  http://sites.google.com/site/amca01/
Facebook: http://www.facebook.com/alasdair.mcandrew

[-- Attachment #1.2: Type: text/html, Size: 4277 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-15  0:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-14  5:27 Increment an item number? Alasdair McAndrew
2012-02-14 12:39 ` Otared Kavian
2012-02-14 12:48   ` Hans Hagen
2012-02-14 16:27     ` Thomas A. Schmitz
2012-02-15  0:10       ` Alasdair McAndrew

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).