# How can I add the word “Chap” before the chapters numbers in the Toc in class report?

At here Adding the word "Chap" before the chapters numbers in the TOC the word Chapter added in \documentclass{book}. Now I want to use them in \documentclass{report}. How can I do that?

Here's the modification for the report class (basically, it's the same code but suppressing the conditional test for the \frontmatter); I defined two commands \AddChap and \SuppChap to activate (deactivate, resp.) the addition:

\documentclass{report}

\makeatletter
\let\orig@chapter\@chapter
\newcommand\SuppChap{%
\let\@chapter\orig@chapter}
\def\@chapter[##1]##2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
{Chap~\protect\numberline{\thechapter}##1}%
\else
\fi
\chaptermark{##1}%
\if@twocolumn
\else
\fi}%
}
\makeatother

\begin{document}

\tableofcontents

\chapter{Acknowledgements}

\chapter{Test Chapter One}
\chapter{Test Chapter Two}

\SuppChap
\appendix
\chapter{Test Appendix One}

\end{document}


• I am a Vietnamese. If I use \usepackage[utf8]{vietnam}. Can I repair the "Chap" into the "Chương" or "Chuong"? – minthao_2011 Feb 12 '14 at 16:03
• How Can add the word Index in \tableofcontents? – minthao_2011 Nov 18 '14 at 16:02

A much simpler solution with the tocloft package.

\documentclass{report}
\usepackage{tocloft}

\newlength\mylength

\renewcommand\cftchappresnum{Chap~}
\settowidth\mylength{\bfseries\cftchappresnum\cftchapaftersnum}

\begin{document}

\tableofcontents

\chapter{Intro}

\chapter{Test}

\end{document}


Output (ToC):

## EDIT

If you want to add the word "Appendix" instead of "Chap" for your appendices, you can load the package etoolbox and add the following lines in your preamble:

\apptocmd{\appendix}
\protect\renewcommand{\protect\cftchappresnum}{Appendix~}%
\protect\settowidth\mylength{\bfseries\protect\cftchappresnum\protect\cftchapaftersnum}%
}{}{}


Complete MWE:

\documentclass{report}
\usepackage{tocloft}
\usepackage{etoolbox}
\apptocmd{\appendix}
\protect\renewcommand{\protect\cftchappresnum}{Appendix~}%
\protect\settowidth\mylength{\bfseries\protect\cftchappresnum\protect\cftchapaftersnum}%
}{}{}

\newlength\mylength

\renewcommand\cftchappresnum{Chap~}
\settowidth\mylength{\bfseries\cftchappresnum\cftchapaftersnum}

\begin{document}

\tableofcontents

\chapter{Intro}

\chapter{Test}

\appendix

\chapter{Conclusions}

\end{document}


Output (ToC):

• If I want to add the word "Appendix" in Toc, how must I do? – minthao_2011 Feb 13 '14 at 5:11
• @minthao_2011 Do you have something like \chapter*{appendix} in your document? – karlkoeller Feb 13 '14 at 5:13
• No. I have some appendices. – minthao_2011 Feb 13 '14 at 5:14
• @minthao_2011 Are you saying that you want to insert the word Appendix instead of Chap for your appendices? – karlkoeller Feb 13 '14 at 5:21
• Yes. I want so. – minthao_2011 Feb 13 '14 at 5:29