\chapter[the title \\ for index]{the title at chapter}
For any strange reason, PDFLaTeX was unable to compile and generate a PDF, if a put a \\ at this area (after \backmatter). I a leave the \\, there's no problem.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Why do you need this manual intervention at all? Line breaks in ToC entries should be done automatically by default. If you could give us a minimal example, we would have a clear problem description and finding a solution would become much easier.
My book has 2 prologues and some epilogues. Only for them, (not for the usual mainmatter chapters) i would an index TOC with 2 lines; The prologue name, and the autor of this prologue. So, for the prologues, i put a \\ inside the \chapter[the name at toc \\ by Steve]{The name at toc}...
The question was that, at backmatter (epilogues) the '\\' solution couldn't be done by this way (causes errors at pdflatex)... but yes!, coul be done (and is ok) putting the \protect\newline... So, thank you Stefan, for this tip!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p