[NTG-context] Resetcounter in custom enumeration environment

Jan-Erik Hägglöf skrantajanneman at gmail.com
Tue Jan 4 17:10:47 CET 2022


Many thanks, that was very structured and helpful.

/Jan-Erik

> 3 jan. 2022 kl. 12:07 skrev kauśika <citturs at gmail.com>:
> 
> On Monday, January 3, 2022 4:34:50 PM IST kauśika wrote:
>> If 'Exercises' and 'Answers to exercises' are some head structure (assuming
>> unnumbered since they are so in your example):
>> \definehead[exercises][subject]
>> \definehead[answers][subject]
>> then you can simply do
>> \setupenumeration[uppgift]
>> [alternative=left,
>> width=1cm,
>> text=,
>> after={\blank[2*big]},
>> way=bysubject]
>> and ConTeXt will automatically restart the number at every new subject
>> block.
> 
> In this case you would have something like :
> 
> \startexercise[title={Exercises}]
>    \startuppgift
>      first exercise
>    \stopuppgift
> 
>    \startuppgift
>      second exercise
>    \stopuppgift
> \stopexercise
> 
> \startanswers
>    \startuppgift
>      answer to first exercise
>    \stopuppgift
> 
>    \startuppgift
>      answer to second exercise
>    \stopuppgift
> \stopanswers
> 
> kauśika
> 
> 



More information about the ntg-context mailing list