1

With reference to my previous question: Change of style in the table of contents

How to make this to get what I stated in the title. For eg. CHAPTER 1, CHAPTER 2 etc. even in the table of contents and at the beginning of the Chapter itself. Any help is much appreciated.

2

Redefine \chaptername to be \MakeUppercase{\chapoldname} and write the change to the ToC itself.

enter image description here

\documentclass[11pt]{report}

\usepackage{amsmath, mathrsfs}
\usepackage{amssymb}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage{tocloft}
\usepackage[nottoc,notlot]{tocbibind}


\let\chapnameold\chaptername


\addtolength{\cftchapnumwidth}{65pt}
\renewcommand{\cftchappresnum}{\textbf{\chaptername}~}


\makeatletter
\AtBeginDocument{%
  \renewcommand{\bibname}{References}
  \addtocontents{toc}{\protect\renewcommand{\protect\chaptername}{\MakeUppercase{\protect\chapnameold}}}
  \renewcommand{\chaptername}{\MakeUppercase{\chapnameold}}
}
\makeatother


%\linespread{1.4}
\pagestyle{myheadings}



\title{This is the title}
\author{Author A and Author B}
\date{}
\begin{document}
\maketitle

\cite{Lam94}

\tableofcontents

\chapter{Foo}

\section{This is section 1}
\subsection{This is a subsection}


\section{This is section 2}
\subsection{This is a subsection}

\chapter{Foobar}

\clearpage
\bibliographystyle{abbrv}
\bibliography{biblio}

\end{document}
| improve this answer | |
  • I try to improve this code later one to make it more 'condense' – user31729 Mar 26 '18 at 19:56
  • Thank you. When I compile the code, there's an error comes "Undefined control sequence. <argument> \cftchapnumwidth l.25 \addtolength{\cftchapnumwidth}{65pt} " – Eureka Mar 27 '18 at 15:40
  • @Fib1123: Works for me out of the box, otherwise I would not have posted this answer. – user31729 Mar 27 '18 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.