Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Overfull hbox in ToC after chapter numbers changed to Roman; see MWE below. With the tocloft package \setlength\cftchapternumwidth{3em} solves the problem.

But: Is there any solution to the problem NOT using tocloft but titletoc?

\documentclass{book}

\usepackage{titletoc}

\begin{document}
\renewcommand{\thechapter}{\Roman{chapter}}
\setcounter{chapter}{7}
\tableofcontents
\chapter{Lipsum}
\section{Introduction}
\subsection{Introduction to introduction}
\subsubsection{Introduction to introduction to introduction}
\end{document}

PS: I have specified certain things in the ToC using titletoc and would be glad not to have to do everything again with tocloft. That's why I want to avoid the tocloft solution!

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Here's an adaption of Philippe Goudet's anwer where the horizontal alignment of the various ToC entries resembles that of the standard classes:

\documentclass{book}

\usepackage{titletoc}
\titlecontents{chapter}[3em]{\addvspace{10pt}\bfseries}
    {\contentslabel{2.5em}}{\hspace{-2.5em}}{\hfill\contentspage}
\dottedcontents{section}[6.3em]{}{3.3em}{0.7pc}
\dottedcontents{subsection}[10.5em]{}{4.2em}{0.7pc}

\renewcommand{\thechapter}{\Roman{chapter}}

\begin{document}
\tableofcontents
\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
\setcounter{chapter}{7}
\chapter{Lipsum}
\section{Introduction}
\subsection{Introduction to introduction}
\subsubsection{Introduction to introduction to introduction}
\end{document}

enter image description here

share|improve this answer
    
Thanks to you both! That's what I was looking for. What's your personal/subjective opinion: In Philippe Goudet's solution the horizontal alignment is somewhat irritating. In lockstep's solution this is better but my impression is that things get too much "stretched". So I cannot decide which solutions looks more professional. Or should I perhaps better stick to the arabic numbers which avoids both of the before mentioned problems? A personal recommendation would be highly appreciated!! –  lpdbw Aug 8 '12 at 11:46
1  
In my opinion, a large indentation of subsections is less irritating than non-aligned entries. Personally, I'd either use arabic numbering or exclude subsections from the ToC (\setcounter{tocdepth}{1}). –  lockstep Aug 8 '12 at 11:53

You can fully personalize the entries with titletoc by using \titlecontents. For each section level, you need to change the left indent and the \contentslabel by choosing an appropriate value:

\documentclass{book}

\usepackage{titletoc}

\renewcommand{\thechapter}{\Roman{chapter}}

\titlecontents{chapter}%
  [3em]% left indent
  {\addvspace{1em plus 0pt}\bfseries}% stuff before
  {\contentslabel{3em}}% before if there's a number
  {\hspace{-3em}}% before if there's no number
  {\hfill\contentspage}% dots and page number
  [\addvspace{0pt}]% stuff after

\dottedcontents{section}%
  [5em]% left indent
  {\addvspace{0pt}}% stuff before
  {3.5em}% spacing of \contentslabel
  {0.75em}% space between the dots
  [\addvspace{0pt}]% stuff after

\dottedcontents{subsection}%
  [7.5em]% left indent
  {\addvspace{0pt}}% stuff before
  {4.25em}% spacing of \contentslabel
  {0.75em}% space between the dots
  [\addvspace{0pt}]% stuff after

\begin{document}

\tableofcontents

\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}

\setcounter{chapter}{7}
\chapter{Lipsum}
\section{Introduction}
\subsection{Introduction to introduction}
\subsubsection{Introduction to introduction to introduction}

\end{document}
share|improve this answer

Your Answer

 
discard

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.