[Tex/LaTex] Make chapter appear in table of contents

bookmarkstable of contents

I want to customize the way the table of contents is provided by LaTeX :

Here is my (minimal) working code (my real preambule is about 300 lines) :

\documentclass[12pt]{book}

% For French
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}

\begin{document}

\tableofcontents

\part{First part}

% A numbered chapter
\chapter{First}

%An unnumbered chapter
\chapter*{Appendix}
\addcontentsline{toc}{chapter}{Appendix}

\end{document}

I want to get a table of contents like that :

Partie I - First Part . . . . 1

Chapitre 1 - First . . . . . .2
Appendix . . . . . . . . . . .3

With my code I get :

I First Part . . . . . . . . . 1
1 First . . . . . . . . . . . .2
Appendix . . . . . . . . . . . 3

In fact managing the unnumbered chapters is simple, I did solve this in my code. But when the chapters are numbered I don't know how to change it in the TOC.
I also want the bookmarks in the pdf (I compile with pdflatex) to be the same as in the TOC i.e here for example "Chapitre 1 – First"

Also, but still not the more important, if it is possible I would like to get the "Chapitre" of "Partie" word in small caps.

I am convinced that this question may have been asked before, but I didn't found an answer to my question.

Many thanks in advance.

Best Answer

Here, I use standard features of the tocloft package. Note, however, that page 10 of the tocloft documentation indicates that \cftpartaftersnum DOES NOT WORK for the standard document classes. Thus, I cannot add an en-dash following the part number.

EDITED to make the words "Partie" and "Chapitre" in small caps. EDITED to center the chapter's en-dash in the white space.

\documentclass[12pt]{book}
\usepackage{tocloft}
\renewcommand\cftpartpresnum{\textsc{Partie}\ }
\renewcommand\cftpartaftersnum{\ --}% ACCORDING TO p.10 OF THE DOCS, THIS MAY NOT WORK
\renewcommand\cftpartafterpnum{\bigskip}
\renewcommand\cftchappresnum{\textsc{Chapitre}\ }
\renewcommand\cftchapaftersnum{\hfill--\hfill}
\renewcommand\cftchapnumwidth{3.2cm}
\renewcommand\cftdotsep{2}
\renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}} 
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} 
% For French
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}

\begin{document}

\tableofcontents

\part{First part}

% A numbered chapter
\chapter{First}

%An unnumbered chapter
\chapter*{Appendix}
\addcontentsline{toc}{chapter}{Appendix}

\end{document}

enter image description here

Related Question