2

When I produce a table of contents in my latex document which is of the report type, with just the plain \tableofcontents command, I see the part numbers and chapter numbers are in the same column. I would like the part numbers to be indented more to the left.

How do I achieve this?

Currently, this is the output I am getting

enter image description here

2

2 Answers 2

2

You can patch how \part writes the part number in the .toc file:

\documentclass{report}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\@part}
  {\thepart\hspace{1em}}
  {\inmargin{\thepart}}
  {}{}
\makeatother
\newrobustcmd{\inmargin}[1]{%
  \makebox[0pt][r]{\makebox[2em][l]{#1}}%
}

\begin{document}

\tableofcontents

\part{Overview}

\chapter{Description of Problems}

\chapter{Installation and Use}

\part{Another one}

\chapter{Whatever}

\end{document}

Here 2em is the width of the box with the part number. Adjust it to suit your needs.

enter image description here

0

When using memoir document class, you can do this:

\documentclass{memoir}

\renewcommand{\cftpartpresnum}{\hskip-15pt}
\renewcommand{\cftpartaftersnumb}{\hskip-15pt}

\begin{document}

\tableofcontents

\part{text}

\chapter{test2}

\chapter{test3}

\end{document}

Left-shifted part number and title

The first specifies something before the part number, while the second specifies something after the part number, immediately before the part name/title.

If you prefer to indent (i.e. shift right), you will want the number(s) to be positive, rather than negative.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .