[NTG-context] Section numbering starting from zero, not one

Hans Hagen j.hagen at freedom.nl
Thu Feb 16 23:41:04 CET 2023


On 2/16/2023 8:07 PM, Alex Leray via ntg-context wrote:
> Answering my own question… this fits my needs:
> 
> ###
> 
> \defineconversion[romannumeralszero][0, I, II, III, IV, V, VI, VII, 
> VIII, IX, X, XI, XII, XIII, XIV, XV, XVI, XVII, XIII, XIX, XX, XXI]
> 
> \setuphead[section][conversion=romannumeralszero]
> 
> \starttext
> \startsection[title={Section zero}]foo\stopsection
> 
> \startsection[title={Section 1}]bar\stopsection
> \stoptext
> 
> ###
> 
> Sorry for the noise

you can often find hints in the test suite (many small files)

> Le 16/02/23 à 17:32, Alex Leray via ntg-context a écrit :
>> Hello,
>>
>> I'd like to have roman numerals prefixed sections, but starting from 
>> Zero and not One (even if I know that roman numerals don't have a sign 
>> for 0).
>>
>> Is there a way to achieve this? My code looks like that at the moment:
>>
>> ###
>>
>> \setuphead[section][conversion=Romannumerals]
>>
>> \starttext
>> \setupheadnumber[section] [-1]
>> \startsection[title={Section zero}]\stopsection
>> \startsection[title={Section one}]\stopsection
>> \stoptext
>>
>> ###
>>
>> Thank you,
>>
>> Alex
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry 
>> to the Wiki!
>>
>> maillist : ntg-context at ntg.nl / 
>> https://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki     : https://contextgarden.net
>> ___________________________________________________________________________________
> 

-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the ntg-context mailing list