2

I am very new to Tex, I am working of a template that someone else has given me.

I am try to change the /part{Part I: my stuff} from looking like this in the TOC

 1 Introduction

 I  Part I: my stuff

 2  Procedure blah blah

 3  Procedure blah blah

 II Part II: my stuff

 4  Procedure blah blah

to something like:

 1 Introduction

 Part I: my stuff

    2  Procedure blah blah

    3  Procedure blah blah

 Part II: my stuff

    4  Procedure blah blah

Currently I have this

%% ---------------------------------------------------------------------- %%
\mainmatter

% Main matter
% -> Global Introduction
\input{Chapters/Introduction.tex} 
%% *****     PART 1     *****
\part*{<Insert Title of First Part>}

\input{Chapters/SummaryPartA.tex}

%% *****     PART 2     *****
\part*{<Insert Title of second Part>}

\input{Chapters/SummaryPartB.tex}

Thank you for your help

4
  • 2
    This partly depends on which documentclass you are using. Can you provide a minimal working example (MWE). Also, tex.stackexchange.com/q/33841/15925 looks very similar to your question. Jan 3 '14 at 12:47
  • Thanks Andrew its actually a custom Thesis class which is based on the book.cls
    – CromeX
    Jan 3 '14 at 13:10
  • The question I linked to is specifically about the book.cls. Does it solve your problem? If not you will need to provide a link to your custom class. Jan 3 '14 at 13:59
  • It helps with the indentation problem, just missing the step to re-edit the part numbering.
    – CromeX
    Jan 4 '14 at 14:35
3

The following works with the book document class, so I hope it will work with yours, too, since it is based on this one.

It seems to me that you want the indenting for \chapters starting with the second one. So we can add a line (requires the tocloft package)

\addtocontents{toc}{\protect\setlength{\cftchapindent}{2em}}

just after the first \chapter.

Also, to have no numbers in the ToC for numbered \parts, we can patch the command \@part through \patchcmd in this way (requires the etoolbox package)

\makeatletter
\patchcmd{\@part}
    {\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}}
    {\addcontentsline{toc}{part}{#1}}
    {}
    {}
\makeatother

Complete MWE:

\documentclass{book}
\usepackage{tocloft}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@part}
    {\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}}
    {\addcontentsline{toc}{part}{#1}}
    {}
    {}
\makeatother

\begin{document}

\tableofcontents

\chapter{Introduction}
\addtocontents{toc}{\protect\setlength{\cftchapindent}{2em}}
\part{Part I: my stuff}
\chapter{Procedure blah blah}
\chapter{Procedure blah blah}
\part{Part II: my stuff}
\chapter{Procedure blah blah}
\end{document} 

Output:

enter image description here

1
  • Karl, Oh Ah. Check didn't appear in my browser. I will delete it.
    – user11232
    Jan 5 '14 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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