3

I have the following table of contents: enter image description here

Is there any way to add the title 'Chapters' before the list of chapters, in the same way that 'Appendices' is shown before the list of appendices?

Thanks in advance for your help.

4
  • \addtocontents{toc}{\protect\chaptername} ?
    – user31729
    Commented Apr 20, 2016 at 18:16
  • What about 1.1 Getting started within that list? It is not a chapter.
    – Johannes_B
    Commented Apr 20, 2016 at 18:28
  • Welcome to TeX - LaTeX! Please post code as a minimal working example (MWE) showing your set-up. Commented Apr 20, 2016 at 18:30
  • Thanks Andrew for letting me know that. Next time I will post a code (I already got an answer to my question). Commented Apr 20, 2016 at 18:42

1 Answer 1

4

Use \addtocontents{toc}{Your title\protect\par}, this will add a similar line.

I leave the font settings to the choice of the O.P.

\documentclass{book}
\usepackage[toc]{appendix}
\begin{document}
\tableofcontents
\addtocontents{toc}{\protect\Huge\bfseries Chapters\protect\par}


\chapter{First}

\chapter{Second} 

\begin{appendices}

\chapter{Appendix Stuff 1}
\end{appendices}

\end{document}

enter image description here

4
  • Great! Thank you Christian for your help. I cannot give you points since I'm new in this forum, and I don't have enough reputation points, though. Commented Apr 20, 2016 at 18:43
  • @LuisFelipe: You're welcome. You will be able to upvote posts at 15 reputation points. If you reach this, you can come back and upvote later on, if you like ;-)
    – user31729
    Commented Apr 20, 2016 at 18:54
  • 1
    haha I just did it! Commented Apr 22, 2016 at 15:27
  • @LuisFelipe: Thanks ;-) This is the way to appreciate the work of users here. Happy TeXing!
    – user31729
    Commented Apr 22, 2016 at 15:29

You must log in to answer this question.

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