[Tex/LaTex] Adding word “Chapter” into Table of Contents for only numbered chapter entries

table of contentstitletoc

I'm trying to use the titletoc package to add the word "Chapter" only to my numbered entries in my Table of Contents. I'm using a report document class. I'm really close (I think), I just need to know how to align the numberless entries with the word "Chapter" from the numbered entries.

Here's what I've got:

\usepackage{titletoc}% 
\titlecontents{chapter}% <section-type>
  [0pt]% <left>
  {}% <above-code>
  {\bfseries\chaptername\ \thecontentslabel\quad}% <numbered-entry-format>
  {\bfseries}% <numberless-entry-format>
  {\bfseries\hfill\contentspage}% <filler-page-format>

Which gives me:

Table of Contents result

I'd like to align those numberless chapters on the left hand side with the word "Chapter". Also, I'm receiving \hbox warnings for the page numbers with four or more characters (such as viii) and am not sure what to do about those. I'm new to LaTeX and am at a loss. I tried looking through the titletoc documentation but was unsuccessful. Thanks in advance!

EDIT: As requested, here is a MWE:

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}

\usepackage{titletoc}% 
\titlecontents{chapter}% <section-type>
  [0pt]% <left>
  {}% <above-code>
  {\bfseries\chaptername\ \thecontentslabel:\quad}% <numbered-entry-format>
  {\bfseries}% <numberless-entry-format>
  {\bfseries\hfill\contentspage}% <filler-page-format>

\usepackage{lipsum}

\usepackage{setspace}

\begin{document}

\pagenumbering{roman}      
\clearpage                  
\setcounter{page}{2}        

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{\numberline{}Abstract}
\lipsum[1]

\chapter*{Acknowledgements}
\addcontentsline{toc}{chapter}{\numberline{}Acknowledgements}
\lipsum[1]

\begin{doublespace}
\renewcommand*{\contentsname}{Table of Contents}
\tableofcontents
\addcontentsline{toc}{chapter}{\numberline{}Table of Contents}
\end{doublespace}

\pagenumbering{arabic}
%\setcounter{page}{255}  % % Uncomment to see \hbox warnings due to long TOC page number

\chapter{Introduction}
\lipsum[1]
\section{Section one}
\lipsum[1]

\chapter{Second Chapter}
\lipsum[1]
\section{Another section}
\lipsum[1]

\end{document}

Note: remove the comment to receive the \hbox warnings. Thanks again

Best Answer

You are not using \addcontentsline in the correct way.

Instead of

\addcontentsline{toc}{chapter}{\numberline{}Abstract}

you have to use

\addcontentsline{toc}{chapter}{Abstract}

and the result will be good.

Also notice that \bfseries can be specified in the first mandatory argument, so not to be repeated in the others:

\titlecontents{chapter}% <section-type>
  [0pt]% <left>
  {\bfseries}% <above-code>
  {\chaptername\ \thecontentslabel:\quad}% <numbered-entry-format>
  {}% <numberless-entry-format>
  {\hfill\contentspage}% <filler-page-format>

MWE:

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}

\usepackage{titletoc}%
\titlecontents{chapter}% <section-type>
  [0pt]% <left>
  {\bfseries}% <above-code>
  {\chaptername\ \thecontentslabel:\quad}% <numbered-entry-format>
  {}% <numberless-entry-format>
  {\hfill\contentspage}% <filler-page-format>

\usepackage{lipsum}

\usepackage{setspace}

\begin{document}

\pagenumbering{roman}
\clearpage
\setcounter{page}{2}

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\lipsum[1]

\chapter*{Acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}
\lipsum[1]

\begin{doublespace}
\renewcommand*{\contentsname}{Table of Contents}
\tableofcontents
\addcontentsline{toc}{chapter}{Table of Contents}
\end{doublespace}

\pagenumbering{arabic}
%\setcounter{page}{255}  % % Uncomment to see \hbox warnings due to long TOC page number

\chapter{Introduction}
\lipsum[1]
\section{Section one}
\lipsum[1]

\chapter{Second Chapter}
\lipsum[1]
\section{Another section}
\lipsum[1]

\end{document} 

enter image description here

In regards of the Overfull \hbox warnings, I don't know a good way to solve it with titletoc, but I know a better way with tocloft, which works much better than titletoc.

So, you can replace the titletoc stuff

\usepackage{titletoc}%
\titlecontents{chapter}% <section-type>
  [0pt]% <left>
  {\bfseries}% <above-code>
  {\chaptername\ \thecontentslabel:\quad}% <numbered-entry-format>
  {}% <numberless-entry-format>
  {\hfill\contentspage}% <filler-page-format>

with

\usepackage[titles]{tocloft}
\newlength\mylength
\renewcommand\cftchappresnum{\chaptername~}
\renewcommand\cftchapaftersnum{:}
\settowidth\mylength{\cftchappresnum\cftchapaftersnum\quad}
\addtolength\cftchapnumwidth{\mylength}

and the following MWE

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}

\usepackage[titles]{tocloft}
\newlength\mylength
\renewcommand\cftchappresnum{\chaptername~}
\renewcommand\cftchapaftersnum{:}
\settowidth\mylength{\cftchappresnum\cftchapaftersnum\quad}
\addtolength\cftchapnumwidth{\mylength}

\usepackage{lipsum}

\usepackage{setspace}

\begin{document}

\pagenumbering{roman}
\clearpage
\setcounter{page}{2}

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\lipsum[1]

\chapter*{Acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}
\lipsum[1]

\begin{doublespace}
\renewcommand*{\contentsname}{Table of Contents}
\tableofcontents
\addcontentsline{toc}{chapter}{Table of Contents}
\end{doublespace}

\pagenumbering{arabic}
\setcounter{page}{255}  % % Uncomment to see \hbox warnings due to long TOC page number

\chapter{Introduction}
\lipsum[1]
\section{Section one}
\lipsum[1]

\chapter{Second Chapter}
\lipsum[1]
\section{Another section}
\lipsum[1]

\end{document} 

will give you the following result

enter image description here