Looking to place the page number on the left of each section heading in the frontmatter's table of contents, similar to the following (where "Title Here" is a section title and the page numbers are hyperlinks):

ToC Picture

By default the "alternative" styles (a through f) always place the page number to the right of the section title. For example:



I cannot determine how to check whether or not to display the chapter title in the ToC.


Here is what I have so far:

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


% Format the ToC style.

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


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


The code on the wiki reveals:

        {     \currentlistentrytitle}\NC\NR

However, there are a number of syntax errors with the code 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 regular ToC, there is no "current chapter" and so the conditional fails.



From the mailing list:

  {\par \leftaligned\bgroup
     \hbox to 2em{\color[red]{#3}}%
         \hskip   1em
  \egroup \par}


Instead of using a setup, apply a command to the list entry format for the sections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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