On Mon, Feb 16, 2009 at 11:28 PM, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

Am 16.02.2009 um 19:22 schrieb Alan Stone:

How do you get the chapter number in front of the chapter heading in the TOC,
in the following example with \setuphead[chapter][number=no] ?

\setuphead[chapter][%
% number=yes]
 number=no]

With "number=no" the current section is no longer written to the utility file
and there is no way to get it in the toc. What you can do is to enable section
numbering but remove it from the output.

\setuphead
 [chapter]
 [numbercommand=\gobbleoneargument,
  distance=0pt]
 
Great ! With \setuphead[alternative=middle] there's still an empty/blank space above the chapter head though (where the chapter number is located when leaving out the numbercommand)...
\showframe
 
\setuplist[chapter][%
 alternative=b,
 criterium=chapter]
 
\setuphead[chapter][%
 alternative=middle,
 number=yes,
 numbercommand=\gobbleoneargument,
 distance=0pt]
 
\starttext
 
 \placecontent[%
  level=chapter,
  alternative=b]
  
 \dorecurse{2}{\chapter{Chapter #1}\dorecurse{20}{\input knuth\par}}
\stoptext
 
Alan
 
 

Wolfgang