Hi,

I am trying to recreate the following ToC entries:

http://i.stack.imgur.com/ig6LX.png

The code on the wiki uses:

    \doifelse\currentlistentrylocation{\structureheadlocation{chapter}}
            {{\bfb\currentlistentrytitle}}
            {     \currentlistentrytitle}\NC\NR

However, there are syntax errors and the conditional expression
assumes that the ToC is being placed on every page. This assumption
allows it to resolve the namedstructureheadlocation value. For a ToC
at the start of a document, there is no "current chapter" and so the
head location for the chapter entry returns 0.

Here is what I have so far:

    \startsetups [list:TOC]
    \starttabulate
    \currentlistentrypagenumber{} \hskip 1em \NC \currentlistentrytitle{} \NR
    \stoptabulate
    \stopsetups

    \definelistalternative
      [TOC]
      [renderingsetup=list:TOC]

    % Format the ToC style.
    \setupcombinedlist[content][
      alternative=TOC,
    ]

    \starttext
      \completecontent
      \startchapter [title=alpha] \stopchapter
        \startsection[title=alphasec] \stopsection
      \startchapter [title=beta]  \stopchapter
        \startsection[title=alphasec] \stopsection
      \startchapter [title=gamma] \stopchapter
        \startsection[title=alphasec] \stopsection
    \stoptext

How do you determine whether or not the chapter title should be displayed?

Thank you!
___________________________________________________________________________________
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