7

I often see two table of contents in books - one for the big overview, one very detailled. I would like to have that too for a book based on Springers svmono template.

I have numbered chapters and unnumbered sections in the book. The tableofcontent produced only shows the parts and the numbered chapters. That ok for an overview. I would like to have another tableofcontent behind the first one showing all the unnumbered sections too - is that possible, and how can I achieve this?

2 Answers 2

7

Here's a possible solution using the titlesec and titletoc packages. titletoc allows you to easily create partial ToCs; in this case, we can easily create a detailed ToC. The explicit option for titlesec was used to easily redefine \section* so as to include the section title in this new detailed table of contents:

\documentclass{book}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}

\titleformat{name=\section,numberless}
  {\normalfont\Large\bfseries}{}{0em}{#1\addcontentsline{ptc}{section}{#1}}

\begin{document}

\renewcommand\contentsname{General Contents}
\tableofcontents
\startcontents
\printcontents{}{-1}{\chapter*{Detailed Contents}}

\part{Test Part One}
\chapter{Test Chapter One}
\section*{Test Section One One}
\section*{Test Section One Two}
\section*{Test Section One Three}
\chapter{Test Chapter Two}
\section*{Test Section Two One}
\section*{Test Section Two Two}
\section*{Test Section Two Three}
\part{Test Part Two}
\chapter{Test Chapter One}
\section*{Test Section One One}
\section*{Test Section One Two}
\section*{Test Section One Three}
\chapter{Test Chapter Two}
\section*{Test Section Two One}
\section*{Test Section Two Two}
\section*{Test Section Two Three}

\end{document}

The two ToCs obtained: the one (general, short ToC) produced by \tableofcontents:

enter image description here

and the detailed one produced by titletoc's \printcontents:

enter image description here

4
  • Great solution - works out of the box for me, thanks a lot! Only some of the section titles seem too long for the ToC, but I seem to remember a package like 'shorttitle' or so (?) that allows to give an alternative shorter title to a section.
    – user17106
    Commented Aug 11, 2012 at 22:24
  • @user17106 I don't know of any such package... Perhaps you could ask a follow-up question? Commented Aug 11, 2012 at 22:36
  • There is already a related question here, I just found it, its simply done by: \section[toc title]{main \\ title}
    – user17106
    Commented Aug 11, 2012 at 23:14
  • @user17106 Yes, the optional argument works for numbered sections; I thought you were talking about unnumbered sections, which would require a little extra work. Commented Aug 11, 2012 at 23:15
8

Use the shorttocpackage:

\usepackage{shorttoc}

Now you can make a second table of contents with the name and depth you like. For example

\shorttableofcontents{Overview}{0}
\tableofcontents

This examples produces a TOC "Overview" with only parts and chapters. You can change the number 0 to a higher one if you like, to get sections and so on too.

4
  • Will this new "Overview" ToC include the unnumbered sections as the OP requested? Commented Aug 11, 2012 at 21:49
  • No, this method doesn't change the normal TOC itself. Springer itself uses \section*{Problems} \addcontentsline{toc}{section}{Problems} in the template. If the OP follows this approach, the shorttocmethod works. Otherwise he has to use your method (which also works with svmono).
    – Ivo
    Commented Aug 11, 2012 at 21:57
  • @Ivo thanks for you answer - I used the other solution, but yours would have been a nice alternative too.
    – user17106
    Commented Aug 11, 2012 at 22:26
  • This works wonderfully and is much more elegant than the accepted answer, which doesn't work for me. Thanks!
    – Rain
    Commented Jul 12, 2023 at 8:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .