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

Alex Leray alexandre at stdin.fr
Thu Feb 16 20:07:41 CET 2023


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


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

-- 
Alexandre Leray
+32 487 947 030

Avez-vous pensé à (vous) offrir Médor ?
https://medor.coop/ideescadeau


More information about the ntg-context mailing list