# Customizing parts in TOC

In the screenshot blue, is it possible to replace the this ( I ) preceding the name of the part by (Part I) ?!.

Here is my MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}

\begin{document}

\tableofcontents

\addtocontents{toc}{\smallskip \hrule height 3pt \vspace{-4.5ex} \vspace{0.2cm}  }
\part{Differential Forms}
\addtocontents{toc}{\vspace{0.2cm} \nobreak\smallskip \hrule height 2.5pt }
\end{document}

• Please post compilable examples. And you had questions similar to this, with tocloft included. Using that package it's quite to achieve this! – user31729 Aug 25 '16 at 15:23
• I didn’t understand what you mean by "compilable examples". Besides, this is a different question ! – Hussein Eid Aug 25 '16 at 15:26
• Your document is a fragment only. It misses \end{document} – user31729 Aug 25 '16 at 15:26
• I edited the post. – Hussein Eid Aug 25 '16 at 15:27

A solution with titlesec and titletoc:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{geometry}
\usepackage[svgnames]{xcolor}

\usepackage{titlesec}
\usepackage{titletoc}

\titleformat{\part}[display]
{\scshape\filcenter}
{\large\partname~\thepart}
{2ex}
{\Large}
[\vspace{5ex}]

\titlecontents{part}[0pt]
{}
{\color{RoyalBlue}\partname~}%numbered, unnumbered
{\hfill\contentspage}

\begin{document}

\tableofcontents

\part{Beginnings}

\section{Things}

\section{More Things}

\end{document}


Use tocloft for example and redefine \cftpartpresnum to contain the word Part (or whatever \partname yields). In order to prevent clashes with the part number, increase the width of the number box with \addtolength{\cftpartnumwidth}{20pt} (The value of 20pt is just a guess, nothing more!)

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}
\usepackage{tocloft}

\renewcommand{\cftpartpresnum}{\partname{} }