3

I have a document like this:

\setuphead[part][placehead=yes]

\definestructureresetset[default][1, 0, 1, 0][1]
\setuphead[sectionresetset=default]

\starttext
    \part{Animals}
        \chapter{Birds}
            \section{Parrot}
            \section{Pelican}
                \subsection{Australian Pelican}
                \subsection{Great White Pelican}
        \chapter{Crabs}
            \section{Spider Crab}
    \part{Trees}
        \chapter{Coniferous}
            \section{Pine}
\stoptext

After compiling, the sectioning appears like this:

1 Animals
    1.1 Birds
        1.1.2 Pelican
            1.1.2.1 Australian Pelican

I need to change the numbering so that it uses whole numbers and no decimals, like this:

1 Animals
    1 Birds
        2 Pelican
            1 Australian Pelican

I checked the ConTeXt Garden's instructions for \definehead, \setuphead, and \setupheads, but could not find a solution.

How can I set section numbers for all titles to use whole numbers, rather than decimals?

marked as duplicate by Aditya, Marco, Kurt, Werner, dustin Jul 23 '13 at 20:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Related question: tex.stackexchange.com/questions/61698/…. The desired outcome is slightly different, but the qestion/answer is essentially the same. – Esteis Jul 23 '13 at 17:18
  • Will other people searching for this problem recognize that this supposedly "duplicate" question answers their question? – Village Jul 23 '13 at 22:51
  • Not always, which is why it is policy to keep both the old and the new question around. All that ‘flag as duplicate’ does, AFAIK, is add a note to one question pointing to the other one. – Esteis Jul 25 '13 at 9:21
4

Use the sectionsegments key. The value is the section element you want to display. You can use a single value or more than one, separated by a colon, e.g. chapter:section.

\setuphead [part] [placehead=yes,page=no]

\setuphead [chapter]    [sectionsegments=chapter]
\setuphead [section]    [sectionsegments=section]
\setuphead [subsection] [sectionsegments=subsection]

\starttext
    \part{Animals}
        \chapter{Birds}
            \section{Parrot}
            \section{Pelican}
                \subsection{Australian Pelican}
                \subsection{Great White Pelican}
        \chapter{Crabs}
            \section{Spider Crab}
    \part{Trees}
        \chapter{Coniferous}
            \section{Pine}
\stoptext

result

Not the answer you're looking for? Browse other questions tagged or ask your own question.