Procházka Lukáš Ing. - Pontex s. r. o. <mailto:l...@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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to