I have the chapters of my text (report class) ideally divided in two main groups: FIRST PART and SECOND PART. Inside the text, right before the first chapter of each part is displayed, I created an isolated page like this:

{\Large\textit{First/Second Part Description}}

I would like to have this division of the text in two parts reflected inside the ToC by having "FIRST/SECOND PART // First/Second Part" Description" appear centered (and maybe bold) right before the first chapter of the first/second part in the ToC, without the page number displayed but maybe with an hyperref to that page (if that's easy, it's not essential).

I have no clue on how to achieve that and any help would be much appreciated!

  • Even inserting the part division by hand in the ToC would be fine, if any other solution is not easily adoptable. But, again, no idea on how to "insert" random text inside a ToC! – lucia de finetti Apr 11 '17 at 22:14
  • there are two commands that will insert material into the .toc file to be added to the contents list. \addcontentsline is usually what is wanted when a page number is also wanted, and \addtocontents when no page number is to appear. i'm sure this question has been asked before. this question might help: How to add a line to the Table of Contents without a page number but if it doesn't, there are others. – barbara beeton Apr 12 '17 at 1:06
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – user36296 Oct 24 '18 at 21:29

This uses the code fragment about the part dividers (why not using \part?) and adds a hypertarget to the relevant page and a centered ToC line which links to the page.





    {\Huge #1}

  %Need \protect to prevent breaking of commands during write process to the .aux file!


\partdivider{First Part}{The Fellowship Of The Ring}


\partdivider{Second Part}{The Two Towers}


\partdivider{Third Part}{The Return Of The King}

\chapter{Other Foobar}


enter image description here

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.