0

I am using class{book}, and when I change the title of Toc using the following command

\renewcommand{\contentsname}{\Large TABLE OF CONTENTS}

the heading goes from enter image description here to enter image description here

Clearly, the headers change accordingly, which I don't want them to. Same for the LoF, LoT, and so on. If I further center the title by using the command

\renewcommand{\contentsname}{\hfill\Large TABLE OF CONTENTS\hfill}

it changes to enter image description here

What I want is to change the title only, without changing the headers. Any suggestions? Thanks ahead.

And here is a sample code I am using

\documentclass[12pt]{book}
\usepackage[affil-it]{authblk}  % use affiliation
\usepackage[top = 2.3cm, bottom = 2.5cm, right = 2.2cm, left = 2.2cm]{geometry}
\usepackage{amsfonts, amsmath, amssymb, array}
\usepackage[none]{hyphenat}
\usepackage[nottoc, notlot, notlof]{tocbibind}

\usepackage{fancyhdr}
\fancyfoot{}
\fancyfoot[C]{\fontsize{10pt}{10pt}\selectfont\thepage} 

\usepackage{tocloft}
\renewcommand\cftsecfont{\normalfont}
\renewcommand\cftsecpagefont{\normalfont}
\renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}}
\renewcommand\cftsecdotsep{\cftdot}
\renewcommand\cftsubsecdotsep{\cftdot}

\begin{document}

\renewcommand{\contentsname}{\hfill\Large TABLE OF CONTENTS\hfill}
\renewcommand{\listfigurename}{LIST OF FIGURES}
\renewcommand{\listtablename}{LIST OF TABLES} 


\pagenumbering{gobble}  
% \clearpage
\renewcommand{\baselinestretch}{2}\normalsize
\pagenumbering{roman}
% \addcontentsline{toc}{chapter}{Table of contents}
\tableofcontents
\clearpage
\listoffigures
\addcontentsline{toc}{chapter}{List of figures}
\clearpage
\phantomsection
\listoftables
\addcontentsline{toc}{chapter}{List of tables}
\clearpage
\pagenumbering{arabic}
\setcounter{page}{1}


\chapter{Hello}
\section{1.1}
\subsection{1.1}
\subsection{1.2}
\subsection{1.3}
\subsection{1.4}
\subsection{1.5}
\subsection{1.6}

\chapter{World}
\section{2.1}
\subsection{2.1}
\subsection{2.2}
\subsection{2.3}
\subsection{2.4}
\subsection{2.5}
\subsection{2.6}


\chapter{Good day}
\section{3.1}
\subsection{3.1}
\subsection{3.2}
\subsection{3.3}
\subsection{3.4}
\subsection{3.5}
\subsection{3.6}

\end{document}

1 Answer 1

1

I'm glad that you are using the tocloft package. I have made four modifications to your MWE that gives you what you are after.

% toctitleprob.tex  SE 599174

\documentclass[12pt]{book}
\usepackage[affil-it]{authblk}  % use affiliation
\usepackage[top = 2.3cm, bottom = 2.5cm, right = 2.2cm, left = 2.2cm]{geometry}
\usepackage{amsfonts, amsmath, amssymb, array}
\usepackage[none]{hyphenat}
\usepackage[nottoc, notlot, notlof]{tocbibind}

\usepackage{fancyhdr}
\fancyfoot{}
\fancyfoot[C]{\fontsize{10pt}{10pt}\selectfont\thepage} 

\usepackage{tocloft}
\renewcommand\cftsecfont{\normalfont}
\renewcommand\cftsecpagefont{\normalfont}
\renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}}
\renewcommand\cftsecdotsep{\cftdot}
\renewcommand\cftsubsecdotsep{\cftdot}

\begin{document}

%\renewcommand{\contentsname}{\hfill\Large TABLE OF CONTENTS\hfill} % don't do this
\renewcommand{\contentsname}{TABLE OF CONTENTS} % but do these instead
\renewcommand{\cfttoctitlefont}{\hfill\Large}
\renewcommand{\cftaftertoctitle}{\hfill}

\renewcommand{\listfigurename}{LIST OF FIGURES}
\renewcommand{\listtablename}{LIST OF TABLES} 


\pagenumbering{gobble}  
% \clearpage
\renewcommand{\baselinestretch}{2}\normalsize
\pagenumbering{roman}
% \addcontentsline{toc}{chapter}{Table of contents}
\tableofcontents
\clearpage
\listoffigures
\addcontentsline{toc}{chapter}{List of figures}
\clearpage
\phantomsection
\listoftables
\addcontentsline{toc}{chapter}{List of tables}
\clearpage
\pagenumbering{arabic}
\setcounter{page}{1}


\chapter{Hello}
\section{1.1}
\subsection{1.1}
\subsection{1.2}
\subsection{1.3}
\subsection{1.4}
\subsection{1.5}
\subsection{1.6}

\chapter{World}
\section{2.1}
\subsection{2.1}
\subsection{2.2}
\subsection{2.3}
\subsection{2.4}
\subsection{2.5}
\subsection{2.6}


\chapter{Good day}
\section{3.1}
\subsection{3.1}
\subsection{3.2}
\subsection{3.3}
\subsection{3.4}
\subsection{3.5}
\subsection{3.6}

\end{document}

Read section 2.2 Changing the titles in the tocloft manual which describes how to change the ToC, etc titles.

1
  • Awesome! That works! Thanks a lot!
    – TurbPhys
    Commented May 30, 2021 at 20:00

You must log in to answer this question.

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