TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

I need to format the table of contents for a compilation of articles in a very specific format:

About this volume
Author 1
    Preface........................first page-last page


Author 2
    Title 2........................first page-last page
Author 3
    Title 3........................first page-last page
Author 4
    Title 4........................first page-last page

Except for a small difference concerning the page number it should look like this (German) example:

Does anyone have ideas how to do it, what packages to use or maybe some coded example?

share|improve this question
Have you tried the tocloft package? – uli Nov 22 '11 at 17:51
Please don't ask "How do I achieve this layout", but rather a question about a specific feature that you're struggling with, one problem per question. This way other users who have a similar problem can benefit from your question and the solutions to it (No one's gonna ask for the same layout as you). It's no problem to ask several questions, if you've made some attempt yourself first. It's enormously helpful to see what you've tried so far to figure out what doesn't work. If you don't know where to start at all, I suggest changing your question to "Packages to customize the table of contents" – doncherry Nov 22 '11 at 17:53
You have now 6 questions with answers, but without an accepted one. If an answer solves your question, please think about accepting it by clicking at the check mark at the left of the answer (which gives reputation to the answerer and to yourself). I think Schweinebacke's (edited) answer solves the question, doesn't it? Additionally you can upvote helpful answers by clicking at the upward-symbol at the left of the answer (the number of upvoted answers is not limited - ok, 40 per day, i.e. if three answers to one question were helpful, you can upvote all three of them). – Stephen Nov 22 '11 at 19:25
@Stephen: Thanks for your explanation. Just did some "accepts" and upvotes. – Moked Nov 22 '11 at 21:51
up vote 7 down vote accepted

Here is a small example with authors at the table of contents and with first till last page.


\providecommand*{\addchap}[1]{% define if, if you are not using a KOMA-Script class

% document commands

\newenvironment{authorsection}[2][]{% optional arg = author; mandatory arg = title
  \addchap{#2}% Don't use a number

\newcommand*{\addtocpart}[1]{% add something like a part but only start a new
                             % (odd) page and set up a toc-entry without page
                             % number

\setcounter{tocdepth}{0}% only chapters at the table of contents
\setcounter{secnumdepth}{-1}% No chapter, section etc. numbers

% toc commands

\newcommand*{\aname}{}% needed to store author until end
\newcommand*{\stitle}{}% needed to store title until end
\newcommand*{\fpage}{}% needed to store page until end
\newcommand{\startauthorsection}[3]{% #1 = author, #2 = title, #3 = page
    \let\l@chapter\@gobbletwo% deactivate chapter entries
  \@dottedtocline{0}{0pt}{1.5em}% use chapter entries with dots
\newcommand*{\finishauthorsection}[1]{% #1 = page
  \endgroup% reactivate normal chapter entries
  \l@chapter{% make a chapter entry
    \normalfont% but with normal font
    \ifx\aname\@empty\unskip\else\mbox{\itshape\aname}\\\fi% show the author if there's any
    \stitle% show the title
  }{\fpage--#1}% and the page range


% neeed more space for page numbers at toc:



\addtocpart{Zu diesem Heft}

\begin{authorsection}[Rüdiger Lux]{Vorwort}


\begin{authorsection}[Hans Seidel]{20 Jahre Forschungsstelle Judentum 1988--2008}

\begin{authorsection}[Harald Samuel]{Leipzig -- Jerusalem -- Rom\protect\\
Mit Hebräisch spielend unterwegs}
  \section{Überschrift innerhalb der Geschichte}


I've used a KOMA-Script class, because AFAIK most Germans like to use them. But you may replace it by a standard class. While you've commented, that you are using \chapter, I'm using a book class. You may change this into a report class. But if you change it into a article class, you have to replace e.g. \addchap by \addsec, \chapter* by \section*, \section by \subsection, \l@chapter by \l@section.

share|improve this answer
Added \addtocontents{toc}{\smallskip \textbf{Zu diesem Heft} \par \smallskip } after ToC and \addtocontents{toc}{\bigskip \textbf{Beiträge} \par \smallskip } after the Vorwort via edit (hope that's ok). – Stephen Nov 22 '11 at 18:57
In my document all the individual articles are chapters (so I modified \authorsection accordingly) but further subdivison in sections and subsections is allowed. Those should be excluded from the table of contents anyway, so I set \setcounter{tocdepth}{\chapterlevel} (otherwise they would even appear in the toc before the chapter they are included in). But then the line with the title name, dots and page numbers disappears from the toc. What am I doing wrong? – Moked Nov 22 '11 at 21:30
@Stephen: Please don't use \pagebreak where \newpage or \cleardoublepage should be used. \pagebreak may result in strange vertical alignment of the paragraphs of the page. I'll change this. – Schweinebacke Nov 23 '11 at 6:43
@Sebastian Krause: Where does the \chapterlevel come from? Which class do you use? Maybe you could add this information simply to your question? – Schweinebacke Nov 23 '11 at 6:45
@Sebastian Krause: Maybe you've done not enough LaTeX runs after the changes. I've changed my answer to use scrbook instead of article, and cleaned up markup of additional material added by Stephen. – Schweinebacke Nov 23 '11 at 7:45

If you are interested in changing the ToC, you might be interested in the titletoc package. You can add arbitrary content (like "Beiträge") to the ToC by \addtocontents{toc}{ <something> }, e.g.

\addtocontents{toc}{\bigskip \textbf{Beiträge} \par \smallskip }

. Whole entries can be added with


(where chapter is the according level, others would be e.g. part or section).

\dotfill \pageref{ first page of chapter label } -- \pageref{ last page of chapter label }

(where there is a label placed at the first and another one at the end of each chapter) would create the "...... 7-12" part of the entries in case you create everything by \addcontentsline, but probably you want a package automatically doing it (sorry, I do not know of any one doing this).

share|improve this answer
But what about the page numbering (first page-last page)? – Werner Nov 22 '11 at 17:57
How about assembling your discussion into a compilable MWE so as to specify the procedure and usage almost verbatim? You never know how many users may benefit from an MWE. – Werner Nov 22 '11 at 18:17
@Werner: Well, Schweinebacke just submitted a MWE which produces a ToC as asked for (I gave +1 for that). Thus there is the MWE, and here is a little explanation about \addtocontents / \addcontentsline. (When Schweinebacke had submitted his MWE first, I would have submitted my answer as comment.) – Stephen Nov 22 '11 at 18:41
@Werner: Added \addtocontents{toc}{\bigskip \textbf{Beiträge} \par \smallskip } and \addtocontents{toc}{\bigskip \textbf{Beiträge} \par \smallskip } after the Vorwort (and the Hans Seidel-Beitrag which is a one-liner) to Schweinebacke's answer, which is now exactly what the OP asked for. – Stephen Nov 22 '11 at 19:01

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.