I have:
\documentclass[12pt]{book}
\begin{document}
\tableofcontents
\chapter{chapter name}
\section{section name}
\subsection{subsection name}
\end{document}
I want to add the word 'Chapter' before the number 1 where it is written chapter name.
I want also to add a point line in front of the chapter name like in the section line.
I try to use this:
\documentclass[12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{newtxtext}
\usepackage[english]{babel}
\usepackage{titletoc}
\addto\captionsenglish{\renewcommand*\contentsname{Contents}}
\titlecontents{chapter}[5.3em]
{\vspace{0.3cm}}
{\contentslabel[\textbf{\chaptername~\thecontentslabel}]{5.3em}}
{\hspace*{-5.3em}}
{\titlerule{1pc}{.}\contentspage}[\smallskip]
\titlecontents{section}[5.3em]
{\smallskip}
{\thecontentslabel\enspace}
{\hspace*{-5.3em}}
{\hfill\contentspage}
\titlecontents{subsection}[6.92em]
{\smallskip}
{\thecontentslabel\enspace}
{\hspace*{-6.92em}}
{\hfill\contentspage}
\begin{document}
\tableofcontents
\newpage
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\chapter{Looking-Glass House}
\section{A First section}
\section{Another section}
\subsection{A subsection}
\end{document}
I have problem with the dotted line and I want that tha chapter nae be bold !
Best Answer
Here is how to do it with
titletoc
. Note you'll have to redo the formatting of lower level sectioning titles (mainly the horizontal spacing) to make the layout consistent. The lengths may have to be adjusted depending on the document font, the font size, &c.