I've faced some issues when making my ToC. I don't want the number before "Part" to be shown, but the code I'm using right now messes up with the configuration that allows me to reset the ennumeration to the Chapters on each Part.
Here's my code
\documentclass[10pt,twoside]{book}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{chngcntr}
\usepackage{textcomp}
\usepackage{mathptmx}
\usepackage{amstext}
\usepackage{amssymb}
%\makeatletter@addtoreset{chapter}{part}\makeatother% %reiniciar los capitulos por parte
% This creates a header on your document---more specifically, a "fancy" header. Specific header info is specified below
\usepackage{fancyhdr}
\pagestyle{fancy}
\headsep=12pt
\headheight=15pt
% This sets special formatting for section titles and such, if you want to create special ones
\usepackage{titlesec}
\titleformat{\section}
{\normalfont\normalsize\bfseries\centering}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\normalsize\itshape}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\normalfont\normalsize\itshape}{\thesubsubsection}{1em}{}
\renewcommand{\thechapter}{\Roman{chapter}}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{xpatch}
\usepackage{blindtext}
\makeatletter
\setlength\parskip{1ex}
\usepackage{lipsum}
\usepackage[titles]{tocloft}%
\renewcommand{\cftchapleader}{~\cftdotfill{5}}
\setcounter{secnumdepth}{0}
\setcounter{tocdepth}{3}
\renewcommand{\contentsname}{Whatever}
\counterwithin*{chapter}{part}
%\cftsetindents{part}{2.5em}{0em}
\cftsetindents{subsection}{0.5em}{0em}
\makeatletter
@addtoreset{chapter}{part}
\makeatother
\renewcommand{\cftchapaftersnum}{.}
\addtolength{\cftchapnumwidth}{10pt}
%\renewcommand{\thechapter}{\roman{chapter}}
%\titleformat{\chapter}{\normalfont\large\bfseries}{\thechapter.}{1em}{}
% to center part
\renewcommand{\cftpartfont}{\hfill\large\bfseries}
\usepackage{xpatch}
\makeatletter
\patchcmd{\l@part}{#1}{#1\hfill\hskip-\rightskip\mbox{}}{}{}
\makeatother
\addtocontents{toc}{\cftpagenumbersoff{part}}
\usepackage{titlesec}
\begin{document}
\frontmatter
\include{front.tex}
\thispagestyle{plain}
\restoregeometry
\pagenumbering{gobble}
\thispagestyle{empty}
\pagenumbering{arabic}
\tableofcontents
\mainmatter
\addcontentsline{toc}{part}{title part 1}
\part{title part 1}
\chapter{A}
\chapter{B}
\chapter{C}
\addcontentsline{toc}{part}{title part 2}
\part{title part 2}
\chapter{A}
\chapter{B}
\chapter{C}
\end{document}
Currently my ToC looks like this:
I "Title Part 1"
chapter 1
chapter 2
II "Title Part 2"
chapter 3
chapter 4
This is similar to whan I'm looking for.
"Title Part 1"
chapter 1
chapter 2
"Title Part 2"
chapter 1
chapter 2
