TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my table of contents, part is defined like this:


I would like to center align the title of the part, so it appears like this in the table of contents:

| Contents |
|          |
|  Part 1  |
| Ch. 1..1 |
| Ch. 2..5 |
| Ch. 3.10 |

I have consulted the article about setuplist at the ConTeXt wiki, but I can see no options for horizontally aligning the entries.

  • How can I center align the part entries in the table of contents?
share|improve this question
Does \setuplist [part] [ pagenumber=no, alternative=a, align=middle, ] achieve what you want? – Philipp Gesang May 12 '12 at 1:18
This almost centers the entries, but it is to the right of center. – Village May 12 '12 at 14:04
up vote 1 down vote accepted

Defining a dedicated list alternative may be the wisest choice:


%%% We’ll wrap the header title into a frame for convenience.
\defineframed [centered_list_frame] [

%%% A new list alternative employing the frame. The three args are:
%%% #1 -> Item number.
%%% #2 -> Item title.
%%% #3 -> Page number (ignored in this example).
\definelistplacement [centered_list_placement]#1#2#3{%
  \centered_list_frame{\words\sc Part #1:\hskip\emwidth#2}%

%%% Here instruct the part list to use the new list alternative.
\setuplist [part] [alternative=centered_list_placement,]



\placelist [part,chapter]

\dorecurse{3} {\part{foo} \dorecurse{5}{\chapter{bar}}}


This way you have complete control over the three items that constitute the TOC entry and can center align them at will.

centered part list header

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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