4

Code

Minimum working example (MWE):

\setuphead[chapter][number=yes,]
\setuphead[section][number=no,]
\setuphead[subsection][placehead=hidden,]

\definehead[scenesubsection][subsection]

\starttext
  \dorecurse{5}{
    \chapter{Chapter Name}
    \section{Section Name}
    \startscenesubsection
    \input tufte
    \stopscenesubsection
  }
\stoptext

Problem

The chapter headings should be enumerated 1 through 5, but some chapter numbers are either hidden or enumerated incorrectly.

The following figure shows the MWE output:

Example Output

Question

How can the problems with chapter numbering be resolved?

Additional Details

$ context --version
mtx-context     | current version: 2017.05.14 19:09

Work Around

Using placehead=no causes the spacing to change when framing an entire section:

Placehead No

Dave Jarvis
  • 11,809

1 Answers1

2

Use a custom counter:

\definecounter[ChapterNumber][
  way=bytext,
  prefix=no,
]

\define[1]\CustomChapter{%
  \incrementcounter[ChapterNumber] 
  \rawcountervalue[ChapterNumber] 
  \hspace[medium]
  #1
} 

\setuphead[chapter][
  align=middle,
  number=no,
  textcommand=\CustomChapter,
]

\setuphead[section][
  align=middle,
  number=no,
]

\setuphead[subsection][
  placehead=hidden,
  number=no,
]

\definehead[scenesubsection][subsection]
Dave Jarvis
  • 11,809