I'm working on the ConTeXt layout of a document that should have chapters (but not sections) numbered from zero. The body text is being converted with pandoc from markdown pulled from a github repository, so I'm looking for a simple command that I can use before \starttext
.
The numbering structure should look like this:
Something like this MWE seems like it should do what I want, but the output is still numbered starting from 1:
\setcounter[chapter][0]
\starttext
\chapter{Zero Unit}
\input knuth
\chapter{One More Time}
\input knuth
\stoptext
Using \setcounter[chapter][-1]
doesn't work any better.
Consulting the ConTeXt Manual (2013) I found a reference for \setupheadnumber
. However this does not work either, as the numbering is for some reason suppressed if a section has zero-valued number:
\setupheadnumber[chapter][-1]
\starttext
\chapter{Zero Unit}
\input knuth
\section{Inner Zero.One}
\chapter{One More Time}
\input knuth
\section{Inner One.One}
\stoptext
That output is especially bad since it conflates the numbering of Chapter 0, section 0.1 with Chapter 1.
I know about using ownnumber=
in sectioning commands, but that would require writing a filter for pandoc that calculates and embeds it throughout the context output, and I'd really like to avoid that. With \setupheadnumber
I could get 99% of the way there and manually set the number in the body text for Chapter Zero, but again I would like to avoid programmatic or manual edits to the body text.
Is it possible to start chapter/section numbering from zero using only commands before \starttext
?