Document Classestitletoc problem

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
yago
Posts: 29
Joined: Sat Dec 13, 2008 6:40 pm

titletoc problem

Post by yago »

I use the packages titlesec and titletoc to format the TOC in a book class document. For the Parts formatting this is the code in the preamble:

\titlecontents{part} [3pc]
{\addvspace{1.5pt}\filcenter}
{}
{\large\bfseries\partname\hspace{1ex}\thepart\\\large}
{}
[\begin{center}\addvspace{-.8pc}\rule{0.2\linewidth}{1pt}\end{center}]

That's looks nice, except for a problem in the second line that's must contain only the title and where appears \thepart before the part title.

For the secion formatting, this is the code I use:

\titlecontents*{section}[1.5em]
{\makebox{\small}}
{\thecontentslabel. }
{}
{, \itshape\thecontentspage}
[.---][.]

But the book have some large section titles, and these titles produce text overflow at the right margin in the TOC. I need a box with non indented and justified text in like the TOC of the document titlesec.pdf and I don't deal with that.

Thank you for your help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Post Reply