Discussion:
[dev-context] Start sections with 0
Wolfgang Schuster
2018-08-11 18:13:59 UTC
Permalink
Hi Hans,

can you add a conversion which let us show 0 as value for the first
chapter etc.


\def\zeronumberconversion#1{\number\numexpr#1-1\relax}

\defineconversion [zero] [\zeronumberconversion]

\defineconversionset [zero] [n,zero] [n]

\setuphead [sectionconversionset=zero]

\starttext

\startchapter [title=Introduction]

\startsection [title=First topic]
\stopsection

\startsection [title=Second topic]
\stopsection

\stopchapter

\stoptext


Wolfgang
Alan Braslau
2018-08-11 22:05:52 UTC
Permalink
Hans does not like counting from zero, for some reason... :-)

Alan



On Sat, 11 Aug 2018 20:13:59 +0200
Post by Wolfgang Schuster
Hi Hans,
can you add a conversion which let us show 0 as value for the first
chapter etc.
\def\zeronumberconversion#1{\number\numexpr#1-1\relax}
\defineconversion [zero] [\zeronumberconversion]
\defineconversionset [zero] [n,zero] [n]
\setuphead [sectionconversionset=zero]
\starttext
\startchapter [title=Introduction]
\startsection [title=First topic]
\stopsection
\startsection [title=Second topic]
\stopsection
\stopchapter
\stoptext
Wolfgang
_______________________________________________
dev-context mailing list
https://mailman.ntg.nl/mailman/listinfo/dev-context
Wolfgang Schuster
2018-08-12 09:22:35 UTC
Permalink
I’m recreating a older document which starts the introduction with 0 and
I don’t plan to change this.

There is no change in the counter needed but all I do is to change the
output in the pdf with the number conversion.

Wolfgang
Post by Alan Braslau
Hans does not like counting from zero, for some reason... :-)
Alan
On Sat, 11 Aug 2018 20:13:59 +0200
Post by Wolfgang Schuster
Hi Hans,
can you add a conversion which let us show 0 as value for the first
chapter etc.
\def\zeronumberconversion#1{\number\numexpr#1-1\relax}
\defineconversion [zero] [\zeronumberconversion]
\defineconversionset [zero] [n,zero] [n]
\setuphead [sectionconversionset=zero]
\starttext
\startchapter [title=Introduction]
\startsection [title=First topic]
\stopsection
\startsection [title=Second topic]
\stopsection
\stopchapter
\stoptext
Wolfgang
_______________________________________________
dev-context mailing list
https://mailman.ntg.nl/mailman/listinfo/dev-context
Loading...