0

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

2

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

  • thanks. It's almost. I use the shorter (optional) chapter title for heads and I want to define a length for the chapter entries so that the longer title will automatically break at a defined point. The frontms entries be aligned horizontally with the chapter entries title and not with their numbers, and the chapter title broken begins right at the same horizontal point and not below the chapter number. Sorry if my english is obscure. – nima Jun 22 '16 at 8:47
  • I mean I need a shorter title for heads. If this is not possible, is it possible to store it in a command and put that command in my page style? – nima Jun 22 '16 at 8:48
  • For your first comment (‘chapter title broken begins right at the same horizontal point and not below the chapter number’), that is the case in my code, or did I misunderstand? As to ‘longer title will automatically break at a defined point’, does this mean the chapter title in the toc has to be enclosed in a \parbox of a predefined length? – Bernard Jun 22 '16 at 8:59
  • For the shorter title for heads (I suppose you mean the headers, at to top of each page), it should be perfectly possible with titletoc. I'll see the details. – Bernard Jun 22 '16 at 9:02
  • Yeah Bernard, I haven't still assimilated or developed the latex language for it but yes I meant to be enclosed in a predefined length parbox. – nima Jun 22 '16 at 9:10

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.