3

I know for centring the Table of contents, the following code is used:

\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}{\hspace*{\fill}\Huge\bfseries}

But what do we use for the List of Figures and the List of Tables?

3

tocloft provides commans to change the formatting for the main lists: the ToC (Table of Contents), the LoT (List of Tables), and the LoF (List of Figures). For example, \cfttoctitlefont allows changes to the font of the ToC; the corresponding command for the LoF is obtained replacing the infix toc with lof in the command name: \cftloftitlefont, and the corresponding command for the LoT is obtained replacing the toc with lot: \cftlottitlefont.

To avoid repeating three times almost the same command in the documentation of the package, the author of the package decided to use a placeholder "Z" representing either toc, lof or lot, so to refer to the three commands discussed above, the documentation uses \cftZtitlefont.

In your case, you need

\renewcommand{\cfttoctitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftaftertoctitle}{\hspace*{\fill}}
\renewcommand{\cftlottitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterlottitle}{\hspace*{\fill}}
\renewcommand{\cftloftitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterloftitle}{\hspace*{\fill}}

A complete example:

\documentclass{article}
\usepackage{tocloft}
\usepackage{showframe}& just for the example

\renewcommand{\cfttoctitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftaftertoctitle}{\hspace*{\fill}}
\renewcommand{\cftlottitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterlottitle}{\hspace*{\fill}}
\renewcommand{\cftloftitlefont}{\hspace*{\fill}\Huge\bfseries}
\renewcommand{\cftafterloftitle}{\hspace*{\fill}}

\begin{document}

\tableofcontents
\listoffigures
\listoftables

\end{document}

enter image description here

The showframe package was used just to have a visual guide for the page layout.

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.