[Tex/LaTex] Modifying Table of contents using titletoc

table of contentstitlesectitletoc

I need to remove the roman numbers of the part class and the alphabetic enumeration marks from the subpart entry. Then I want the chapter to have arabic numbers. As I tried to show some chapter titles are too long or have subtitles which I use optional argument of the chapter command to be able to use them in the heads. But I need the title e.g. "The Formation of the Concept of History: in the Minds of the Primitives through…" in table of contents so I manually added it to toc. I also want to have a break line after Minds and other similar titles in terms of lenght. And when a number is attached to chapter entries in toc when the line is broken the rest of the chapter title in the next line start right from below the text on the previous line not below the number of that entry. And the title of chapter begin on the same horizontal position as preface, figures.

Thanks and I'm terribly sorry for making a list of requests.

\documentclass[b5paper]{book}
\usepackage{kantlipsum}
\usepackage{geometry}
\usepackage{titletoc}
\usepackage[rm,small,center,compact,newparttoc,clearempty,toctitles,pagestyles]{titlesec}
% New Sectioning Levels
    % frontms
    \titleclass{\frontms}{page}[\chapter]
    \newcounter{frontms}
    \renewcommand{\thefrontms}{\Alph{frontms}}
    \newcommand{\frontmsname}{FMs}
    \titlespacing{\frontms}{0pt}{0pt}{0pt}
    % subpart
    \titleclass{\subpart}{page}[\part]
    \newcounter{subpart}
    \renewcommand{\thesubpart}{\Alph{subpart}}
    \newcommand{\subpartname}{Subpart}
    \titlespacing{\subpart}{0pt}{0pt}{0pt}

% Sectioning Levels' Format
\titleformat{\frontms}[display]{\centering\Large\bfseries}{}{}{\huge}
\titleformat{\subpart}[frame]{\centering\Large\bfseries}{\subpartname~\thesubpart}{1pc}{\Huge\bfseries}
\titleformat{\part}[display]{\centering\Huge\bfseries}{\partname~\thepart}{1pc}{\Huge\bfseries}

% Formatting toc enteries
\titlecontents{part}[0pt]{\addvspace{2pc}}{\thecontentslabel\enspace\enspace\large\bfseries}
{\Large\bfseries}{\hspace{1em plus 1fill}\large\contentspage}

\titlecontents{subpart}[0pt]{\addvspace{1pc}}{\thecontentslabel\enspace\enspace\large\itshape}{\Large}{\hspace{2em plus 1fill}\large\contentspage\itshape}

\titlecontents{frontms}[15pt]{\addvspace{-2pt}}{\thecontentslabel\enspace\enspace\large}
{\large\itshape}{\hspace{1em plus 1fill}\large\contentspage}

\titlecontents{chapter}[0pt]{\addvspace{10pt}}{\thecontentslabel\enspace\enspace\normalsize\bfseries}{\large}{\hspace{1em plus 1fill}\large\contentspage}



% Main Page Style
\newpagestyle{main}{
    \sethead[][\parttitle][] % even
    {}{\chaptertitle}{} % odd
    \setfoot[][\thepage][]
    {}{\thepage}{}
    \settitlemarks{part,chapter}}
\pagestyle{main}
\setcounter{secnumdepth}{0}
\usepackage{times}
\begin{document}


\frontmatter

\listoffigures
\addcontentsline{toc}{frontms}{Figures}
\frontms[Preface]{Preface}
\frontms{Acknowledgments}
\tableofcontents
\mainmatter
\pagestyle{main}

\part{History}

\subpart{Primitive Historians}

\chapter[The Formation of the Concept of History]{The Formation of the Concept of History:\\{in the Minds of the Primitives through ...}}
%\addcontentsline{toc}{chapter}{The Formation of the Concept of History: in the Minds of the Primitives through...}
\chapter{title}
\kant[1-10]
\part{History}

\subpart{Primitive Historians}

\chapter[The Formation of the Concept of History]{The Formation of the Concept of History:\\{in the Minds of the Primitives through ...}}
%\addcontentsline{toc}{chapter}{The Formation of the Concept of History: in the Minds of the Primitives through...}
\chapter{title}
\kant[1-10]
\end{document}

enter image description here

Best Answer

Is this what you want? Note I replaced the obsolete package times with newtxtext, newtxmath, which provides true smallcaps and a few other glyphs.

\documentclass[b5paper]{book}
\usepackage{kantlipsum}
\usepackage{geometry}
\usepackage{xcolor} \usepackage{titletoc}
\usepackage[rm,small,center,compact,newparttoc,clearempty,toctitles,pagestyles, newlinetospace]{titlesec}
% New Sectioning Levels
    % frontms
    \titleclass{\frontms}{page}[\chapter]
    \newcounter{frontms}
    \renewcommand{\thefrontms}{\Alph{frontms}}
    \newcommand{\frontmsname}{FMs}
    \titlespacing{\frontms}{0pt}{0pt}{0pt}
    % subpart
    \titleclass{\subpart}{page}[\part]
    \newcounter{subpart}
    \renewcommand{\thesubpart}{\Alph{subpart}}
    \newcommand{\subpartname}{Subpart}
    \titlespacing{\subpart}{0pt}{0pt}{0pt}

% Sectioning Levels' Format
\titleformat{\frontms}[display]{\centering\Large\bfseries}{}{}{\huge}
\titleformat{\subpart}[frame]{\centering\Large\bfseries}{\subpartname~\thesubpart}{1pc}{\Huge\bfseries}
\titleformat{\part}[display]{\centering\Huge\bfseries}{\partname~\thepart}{1pc}{\Huge\bfseries}

% Formatting toc entries
\titlecontents{part}[0pt]{\addvspace{2pc}}{\large\bfseries}%
{\Large\bfseries}{\hspace{1em plus 1fill}\large\contentspage}

\titlecontents{subpart}[0pt]{\addvspace{1pc}}{\large\itshape}{\Large\hspace*{-2em}}{\hspace{2em plus 1fill}\large\contentspage\itshape}%

\titlecontents{frontms}[0pt]{\addvspace{-2pt}}{\large}%
{\large\itshape}{\hspace{1em plus 1fill}\large\contentspage}

\titlecontents{chapter}[0pt]{\addvspace{10pt}}{\contentspush{\thecontentslabel\quad}\normalsize\bfseries}{\Large}{\hspace{1em plus 1fill}\large\contentspage}

% Main Page Style
\newpagestyle{main}{
    \sethead[][\parttitle][] % even
    {}{\chaptertitle}{} % odd
    \setfoot[][\thepage][]
    {}{\thepage}{}
    \settitlemarks{part,chapter}}
\pagestyle{main}
\setcounter{secnumdepth}{0}
\usepackage{newtxtext, newtxmath}
\begin{document}


\frontmatter

\listoffigures
\addcontentsline{toc}{frontms}{Figures}
\frontms{Preface}
\frontms{Acknowledgments}
\tableofcontents
\mainmatter
\pagestyle{main}

\part{History}

\subpart{Primitive Historians}

\chapter{The Formation of the Concept of History: \\in the Minds of the Primitives through ...}
%\addcontentsline{toc}{chapter}{The Formation of the Concept of History: in the Minds of the Primitives through...}[The Formation of the Concept of History]
\chapter{title}
\kant[1-10]
\part{History}

\subpart{Primitive Historians}

\chapter{The Formation of the Concept of History:\\ in the Minds of the Primitives through ...}
%\addcontentsline{toc}{chapter}{The Formation of the Concept of History: in the Minds of the Primitives through...}[The Formation of the Concept of History]
\chapter{title}
\kant[1-10]
\end{document} 

enter image description here

Related Question