0

Currently, my table of contents looks like this:

enter image description here

What command can I use to add the word "Chapter" before each chapter number? I want it to say:

"Chapter 1. Introduction..." instead of just "1 Introduction." and
"Chapter 2. Some Background Information..." instead of just "2 Some Background Information"

Currently, I'm using the following code to create the table of contents:

\usepackage {tocloft}

\renewcommand\cftchapdotsep{\cftdotsep}

\tableofcontents

2 Answers 2

0

You already use one macro from the tocloft package so why not use its additional facilities?

% chaptocprob.tex  SE 636777

\documentclass{book}

\usepackage{tocloft}
\renewcommand{\cftchapdotsep}{\cftdotsep}

\renewcommand{\cftchappresnum}{Chapter } % put this before the number
\addtolength{\cftchapnumwidth}{4em} % extra space for number and pre-name
\renewcommand{\cftchapaftersnum}{.} % put period after chapter number

\begin{document}

\tableofcontents

\chapter{Introduction}
\section{First section}

\end{document}

enter image description here

1
  • Thank you! This was exactly what I wanted to do. I just added a space after the added period, but other than that, this was the needed code.
    – Stephen
    Mar 14, 2022 at 19:05
1

You wan't like this ?

enter image description here

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

\begin{document}
\tableofcontents
\chapter{Introduction} 
\section{First section}
\lipsum[1]
\chapter{Some Background Information}
\section{First section} \lipsum[2-3]
\section{Second section} \lipsum[4-5]
\section{Last section} \lipsum[6-7]
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .