GeneralHow to set the tableofcontents texts

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
chandangiri
Posts: 20
Joined: Thu Sep 06, 2007 7:31 pm

How to set the tableofcontents texts

Post by chandangiri »

when I am using the \tableofcontents after \maketitle in a report documentclass it creates the Table of contents ok. But as the chapter title is long, in table of contents the page numbers are not in proper indentation and the hedaings are make a long line of text. How to control the text in table of contents so that eevrything should be in proper form?
Please suggest.

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to set the tableofcontents texts

Post by gmedina »

You can use the optional argument of the sectional commands: For \chapter, use

Code: Select all

\chapter[Short name]{Long name}
"Short name" will appear in the TOC whilst "Long name" will appear in the body of your document.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
chandangiri
Posts: 20
Joined: Thu Sep 06, 2007 7:31 pm

Re: How to set the tableofcontents texts

Post by chandangiri »

will it be same for sections also? Similarly in the list of figures too how it can be controlled? Using \caption{Short name}{Longe name}?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: How to set the tableofcontents texts

Post by localghost »

Of course it will. These short titles also will appear in the headers if you declared some. And so do the short forms of captions in the LoF and LoT.
Last edited by localghost on Mon Nov 26, 2007 8:40 pm, edited 2 times in total.
chandangiri
Posts: 20
Joined: Thu Sep 06, 2007 7:31 pm

Re: How to set the tableofcontents texts

Post by chandangiri »

Thanks buddy it works...
Post Reply