TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have long chapter and section titles in my document, so titles in the table of contents do not fit into one line. I have two problems regarding with this:

  1. When the second line starts, i need to indent it to the right a bit, but i do not know how.
  2. When a chapter title is too long to fit in one line, the line continues till the margin of the page numbers. I need this line to cut before the page number box, leaving this space empty and continue with the second line.

Here is an example:

    Some text here 
  \section{Table of Contents, List of Figures, List of Tables and List of Symbols/Abbreviations} 
  Some more text 

The style package is provided to me and here is the part relevant to the toc.

% Table of Contents
\renewcommand\contentsname{TABLE OF CONTENTS}
\renewcommand\tableofcontents{% \ev is used for temporary storage of \parskip
% A line as 'TABLE OF CONTENTS' must not appear in the
% Table of Contents. Hence we reproduce the \chapter* here except that
% no entry is put into the toc file.
     \clearpage  \global\@topnum\z@
      { \normalfont
       \large \bfseries  \contentsname\par\nobreak
       \vskip21pt \vskip0.8\baselineskip
% FBE style TOC does not have bold lines.
  \ifnum \c@tocdepth >\m@ne
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \hskip -\leftskip
      #1\nobreak\leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep
       mu$}\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
% The spacing of the TOC lines has been redefined.
share|improve this question
Maybe your question is answered here. (Possible duplicate?) – Hendrik Vogt Nov 8 '10 at 9:06
It looks similar but i do not have any problem with my page numbers, they are all placed right. However, for the 2nd example given there my second line is shifted to left, and when the title is broken into two lines, the first line continues till where the page number should have been. – Basak Nov 8 '10 at 11:56
I get this output. Except for the slightly overfull hbox, can you please specify what you don't like about it? – Hendrik Vogt Nov 10 '10 at 15:11
Actually this is the result i have intended to get. So, I think there is a conflict in my sty file which can be found here: dl.dropbox.com/u/9471314/fbe_tez.sty – Basak Nov 11 '10 at 12:40
up vote 2 down vote accepted

You could use the tocloft package to customize the table of contents. It provides commands to modify indentation and page number width. Have a look at the documentation (texdoc tocloft or follow the link to CTAN), search for the macros \cftXindent and \cftXnumwidth for instance.

Without tocloft it may be a bit harder, for instance by adjusting \@pnumwidth like mentioned in The format of the Table of Contents in the UK TeX FAQ.

share|improve this answer

Without a complete example which (beside other informations) would at least show the class you are using you first question can't be answered in a senseful way. Regarding your second question my cristal ball tells me that you should use hyperref with the option linktocpage. See also http://www.tex.ac.uk/cgi-bin/texfaq2html?label=breaklinks

share|improve this answer
I tried to improve the question, added an example and a part of the style file. Hope this would be more clear. – Basak Nov 10 '10 at 6:58
There is no sensible breakpoint, so you get an overful hbox. You could try to add some stretchable space to \rightskip in \l@chapter e.g. \rightskip \@pnumwidth plus 2em – Ulrike Fischer Nov 10 '10 at 10:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.