Hello, can a section head be generated with the number 0 (or less)? Sometimes I need to prepend a section while keeping existing section head numbers... Example: ---- \starttext \setupheadnumber[chapter][-1] \chapter{Ch0} % Getting "Ch0" instead of "0. Ch0"? \chapter{Ch1} \stoptext ---- Here, "0. Ch0" is not generated, the zero is not displayed; why? Best regards, Lukas -- Ing. Lukáš Procházka | mailto:LPr@pontex.cz Pontex s. r. o. | mailto:pontex@pontex.cz | http://www.pontex.cz Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 Fax: +420 244 461 038
Procházka Lukáš Ing. - Pontex s. r. o. mailto:LPr@pontex.cz 29. August 2015 16:11 Hello,
can a section head be generated with the number 0 (or less)?
Sometimes I need to prepend a section while keeping existing section head numbers...
Example:
---- \starttext \setupheadnumber[chapter][-1] \chapter{Ch0} % Getting "Ch0" instead of "0. Ch0"? \chapter{Ch1} \stoptext ----
Here, "0. Ch0" is not generated, the zero is not displayed; why? You can't set a negative number for the start of the counter but you can change the appereance.
\defineexpandable[1]\PreviousNumber {\number\numexpr#1-1\relax} \defineconversion[PreviousNumber][\PreviousNumber] \defineconversionset[zerostart][n,PreviousNumber][n] \setuphead[chapter,section][sectionconversionset=zerostart] \starttext \chapter{First chapter} \chapter{Second chapter} \stoptext Wolfgang
... Great, thanks for the answer. Lukas
On Tue, 08 Sep 2015 21:10:51 +0200, Wolfgang Schuster
Procházka Lukáš Ing. - Pontex s. r. o. mailto:LPr@pontex.cz 29. August 2015 16:11 Hello,
can a section head be generated with the number 0 (or less)?
Sometimes I need to prepend a section while keeping existing section head numbers...
Example:
---- \starttext \setupheadnumber[chapter][-1] \chapter{Ch0} % Getting "Ch0" instead of "0. Ch0"? \chapter{Ch1} \stoptext ----
Here, "0. Ch0" is not generated, the zero is not displayed; why? You can't set a negative number for the start of the counter but you can change the appereance.
\defineexpandable[1]\PreviousNumber {\number\numexpr#1-1\relax}
\defineconversion[PreviousNumber][\PreviousNumber]
\defineconversionset[zerostart][n,PreviousNumber][n]
\setuphead[chapter,section][sectionconversionset=zerostart]
\starttext \chapter{First chapter} \chapter{Second chapter} \stoptext
Wolfgang
-- Ing. Lukáš Procházka | mailto:LPr@pontex.cz Pontex s. r. o. | mailto:pontex@pontex.cz | http://www.pontex.cz Bezová 1658 147 14 Praha 4 Tel: +420 241 096 751 Fax: +420 244 461 038
participants (2)
-
Procházka Lukáš Ing. - Pontex s. r. o.
-
Wolfgang Schuster