Center the List of Tables title in such a way that the section “List of Table” is not affected in the TOC

table of contentstocbibindtocloft

This is a follow up question to this discussion: How do I center the table of contents title using tocloft?

I can center the List of Figures as seen below
enter image description here

But it shows up in the TOC kinda "funky" as seen below (what it does now and what i would like to change)

enter image description here

I would LIKE the output to look like this

enter image description here

The code i am using:

\renewcommand{\contentsname}{\hfill\bfseries\Large Table of Contents\hfill}   
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\listtablename}{\hfill\bfseries\Large List of Tables\hfill} % no \hfill after "List of Tables"...
\renewcommand{\cftafterlottitle}{\hfill}
\renewcommand{\listfigurename}{\hfill\bfseries\Large List of Figures\hfill} % no \hfill after
\renewcommand{\cftafterloftitle}{\hfill}

Is there a fix to this?

I am using Pdflatex with the article document class. I had to include this code after the preamble (the things above are in the preamble) to add the lof,lot to the TOC.

\tableofcontents
\listoffigures
\listoftables

I am using the package

\usepackage[nottoc]{tocbibind}

to add the items to the TOC.

Best Answer

This answer is in part taken from center ToC title using tocloft

e

x

z

To have the Table of Contents, List of Figures, and List of Tables as titles centered on their respective pages using tocloft, you can use the solution provided in the answer cited above.

To have "List of Figures' and "List of Tables" in the ToC add \addcontentsline{toc}{section}{List of Figures} and \addcontentsline{toc}{section}{List of Tables} to your document. (see the example)

Do not use \usepackage[nottoc]{tocbibind}

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}    
\renewcommand{\familydefault}{\sfdefault}

\usepackage{tocloft}

%%% \usepackage[nottoc]{tocbibind} % DO NOT USE <<<<<<<

\renewcommand{\contentsname}{\bfseries \hfill Table of Contents\hfill}   
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\listtablename}{\hfill\bfseries\Large List of Tables} % no ending \hfill <<<<<<
\renewcommand{\cftafterlottitle}{\hfill}
\renewcommand{\listfigurename}{\hfill\bfseries\Large List of Figures} % no ending \hfill <<<<<<
\renewcommand{\cftafterloftitle}{\hfill}


\begin{document}

    \tableofcontents
        
    \newpage
    \section*{Signature Block}
    \addcontentsline{toc}{section}{Signature Block}
    \newpage
    \section*{Record of Revision}
    \addcontentsline{toc}{section}{Record of Revision}
    
    \newpage
    \addcontentsline{toc}{section}{List of Figures} % added <<<<<<<<<<<<<<
    \listoffigures
    
    \newpage
    \addcontentsline{toc}{section}{List of Tables} % added <<<<<<<<<<<<<<
    \listoftables
    
    \newpage        
    \section*{Glossary}
    \addcontentsline{toc}{section}{Glossary}
    \newpage        
    \section{Introduction}
    \newpage
    \section{Methodology}
    
                
    \begin{figure}[ht!]
        \caption{A}
    \end{figure}
    
    \begin{figure}[ht!]
        \caption{B}
    \end{figure}
    
    \begin{figure}[ht!]
        \caption{C}
    \end{figure}

    \newpage
    
    \begin{table}[ht!]
        \caption{A}
    \end{table}
    
    \begin{table}[ht!]
        \caption{B}
    \end{table}
    
    \begin{table}[ht!]
        \caption{C}
    \end{table}
\end{document}
Related Question