If you want to format the TOC line you have to use command=... together with 
alternative=command.



\define[3]\ChapterNumber{\line{Chapter #1: #2\hfill#3}}

\setuplist
  [section]
  [alternative=command,
   command=\ChapterNumber]

\starttext

\completecontent

\startsection[title={blabla}]
  blabla
\stopsection

\startsection[title={blabla}]
  blabla
\stopsection

\startsection[title={blabla}]
  blabla
\stopsection

\stoptext



If you want to use numbercommand anyway, then make sure that you use it 
correctly.  It only takes
one argument and you have increase the width of number field.



\define[1]\ChapterNumber{Chapter #1:}

\setuplist
  [section]
  [width=2.5cm,
   numbercommand=\ChapterNumber]

\starttext

\completecontent

\startsection[title={blabla}]
  blabla
\stopsection

\startsection[title={blabla}]
  blabla
\stopsection

\startsection[title={blabla}]
  blabla
\stopsection

\stoptext

On Mon, 2017-12-11 at 10:06 +0800, SteamedFish wrote:
> 
> I don’t know if I use it wrongly, or it’s a bug in ConTeXt, but use 
> \setuplist with numbercommand
> renders wrongly 
> 
> 
> 
> % this is not working, ``chapter’’ and chapter name overlapped
> \define[2]\ChapterNumber{chapter #1: #2}
> % have to add extra spaces here to avoid overlapping
> % \define[2]\ChapterNumber{chapter #1:\space\space\space\space\space\space #2}
> \setuplist[section][numbercommand=\ChapterNumber]
> \starttext
> \completecontent
> \section{blabla}
> blabla
> \section{blabla}
> blabla
> \section{blabla}
> blabla
> \stoptext
> 
> 
> 
> 
> 
> 
> 
> 
> I use ConTeXt standalone with Mac OS X
> 
> mtx-context     | ConTeXt Process Management 1.02
> mtx-context     |
> mtx-context     | main context file: /Volumes/DATA/ConTeXt/tex/texmf-
> context/tex/context/base/mkiv/context.mkiv
> mtx-context     | current version: 2017.12.04 16:37
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to