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
But it shows up in the TOC kinda "funky" as seen below (what it does now and what i would like to change)
I would LIKE the output to look like this
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
To have the
Table of Contents
,List of Figures
, andList of Tables
as titles centered on their respective pages usingtocloft
, 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}