# Remove part numbering on TOC

I'm currently using \documentclass{book} and I'd like to remove the roman numeral before the parts of my TOC. It currently looks like this:

What I did before was use \part* and \addcontentsline{toc}{part}{this is the first part} but I figured that I need the \part numbering for a different code thus, I have to strictly use \part.

You don't have to use the starred version if you want no part label to appear in the toc. With the newlinetospace option, it is needless to use the optional argument to remove a line break in titles: it is automatically converted to a horizontal space in table of contents and headers.

\documentclass[12pt,a4paper,oneside]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage[newlinetospace, newparttoc]{titlesec}

\titleformat{\part}[display]{}{}{1em}{\sffamily\huge}

\usepackage{titletoc}
\titlecontents{part}[0em]
{\vspace{2em}\large\bfseries\sffamily\relax}
{\contentslabel[\relax]{0em}}{}{\hfill\contentspage}

\begin{document}

\tableofcontents

\part{Introduction}
Bla

\part{Example 1:\\Foo}%
Bla

\part{Example 2:\\Bar}%[
Bla

\part{Appendix}
Bla

\end{document}


If you feel the answer is as per your requirements please upvote the answer by clicking on the red triangle at the left and the tick mark below it

• amazing!! this works really well! Thank you!!! Nov 29 '19 at 2:57

You can patch \@part (defined in book.cls) and remove the insertion of \thepart and the subsequent space (\hspace{1em}):

\documentclass{book}

\usepackage{etoolbox}

\makeatletter
\patchcmd{\@part}% <cmd>
{\thepart\hspace{1em}}% <search>
{}% <replace>
{}{}% <success><failure>
\makeatother

\begin{document}

\tableofcontents

\part{First part}

\end{document}