[NTG-context] \setupheadnumber and zero

Procházka Lukáš Ing. - Pontex s. r. o. LPr at pontex.cz
Wed Sep 9 13:25:11 CEST 2015


... Great, thanks for the answer. Lukas


On Tue, 08 Sep 2015 21:10:51 +0200, Wolfgang Schuster <schuster.wolfgang at gmail.com> wrote:

>> Procházka Lukáš Ing. - Pontex s. r. o. <mailto:LPr at 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 at pontex.cz
Pontex s. r. o.      | mailto:pontex at pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038



More information about the ntg-context mailing list