0

I have reached this: enter image description here

To look like this: image So that the page number is in front of the title of the part and aligned with the other page numbers, and the title of the part is aligned with the part number. Extra: Is it possible, for example, to have only "Part One" in \sc format?

Here is the code I got so far from other answers:

\documentclass{report}
\usepackage[newparttoc]{titlesec}
\usepackage{titletoc}
\usepackage{titleps}
\usepackage{stackengine}
\usepackage{fmtcount} % For part number in written form
\renewcommand{\thepart}{\Numberstring{part}}

\titleclass{\part}{top}
\titleformat{\part}[display]{\centering\normalfont\large}{\partname>\hspace{4pt}\thepart}{0pt}{\Large}

\titlecontents{part}
               [0cm]
               {\Large\bfseries\protect\addvspace{15pt}}%
              {Part \thecontentslabel\bclap}
              {}%
               {\enspace\hfill\thecontentspage}%

\begin{document}

\tableofcontents

\part{Title of Part One}
\chapter{chapter} 
\section{section}

\part{Title of Part Two}
\chapter{chapter} 
\section{section}

\end{document}
hehe_br
  • 303

2 Answers2

2

Like this?

\documentclass{report}
\usepackage[newparttoc]{titlesec}
\usepackage{titletoc}
\usepackage{titleps}
\usepackage{stackengine}
\usepackage{fmtcount} % For part number in written form
\renewcommand{\thepart}{\Numberstring{part}}

\titleclass{\part}{top}
\titleformat{\part}[display]{\centering\normalfont\large}{\partname\hspace{4pt}\thepart}{0pt}{\Large}

\titlecontents{part}
[0cm]
{\protect\addvspace{15pt}}%
{\Large\textsc{Part \thecontentslabel}\newline\bfseries}%
{}%
{\Large\bfseries\hfill\thecontentspage\hspace*{-1.2pc}}%

\begin{document}

\tableofcontents

\part{Title of Part One}
\chapter{chapter} 
\section{section}

\part{Title of Part Two}
\chapter{chapter} 
\section{section}

\end{document}

enter image description here

  • Your reply works well. I have chosen the other as it is cleaner on setting the page number on the second line! Thanks for your attention! – hehe_br Jul 23 '16 at 23:22
2

Here is a solution. However to have part name in small caps and boldface, you need a font which has bold small caps. I used garamondx for this.

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry}
\usepackage[newparttoc]{titlesec}
\usepackage{garamondx}
\usepackage{titletoc}
\usepackage{titleps}
\usepackage{fmtcount} % For part number in written form
\renewcommand{\thepart}{\Numberstring{part}}

\titleclass{\part}{top}
\titleformat{\part}[display]{\centering\normalfont\large}{\partname>\hspace{4pt}\thepart}{0pt}{\Large}

\titlecontents{part}
               [0cm]
               {\contentsmargin{0cm}\large\bfseries\protect\addvspace{15pt}}%
              {\textsc{Part \thecontentslabel}\newline}
              {}%
{\hspace{\fill}\thecontentspage}%

\begin{document}

\tableofcontents

\part{Title of Part One}
\chapter{chapter}
\section{section}

\part{Title of Part Two}
\chapter{chapter}
\section{section}

\end{document} 

enter image description here

Bernard
  • 271,350
  • It is interesting that with \fill the page number goes all the way to the second line. Clean answer, works well! – hehe_br Jul 23 '16 at 23:20
  • 1
    The reason is not \fill. It is that, at the end of the second mandatory argument (the arguments with contents label) there is a implicit argument, which is the part (or more generally the section) title, and the very last command applies to this argument (just like with titlesec – but this is not well documented). The very last command here is \newline, so that \hfill is on this newline, after the title. – Bernard Jul 23 '16 at 23:32