TransWikia.com

Center Contents heading in tocloft v2.3f

TeX - LaTeX Asked by James Rohal on July 20, 2021

In the past, I believe this technique was used to center the Contents heading in the table of contents via tocloft:

documentclass{report}
usepackage{tocloft}

renewcommand{cfttoctitlefont}{hfill Huge}
renewcommand{cftaftertoctitle}{hfill}

begin{document}

tableofcontents

chapter{Chap 1}
chapter{Chap 2}
chapter{Chap 3}

end{document}

However I recently updated the package to version v2.3f (2013-05-02) and this no longer centers the heading.

contents

How do I fix this? The answers for a related question do not work.

2 Answers

From the comment by Marco Daniel, the following modification works.

documentclass{report}
usepackage{tocloft}

renewcommand{cfttoctitlefont}{hfil Huge}

begin{document}

tableofcontents

chapter{Chap 1}
chapter{Chap 2}
chapter{Chap 3}

end{document}

enter image description here

Correct answer by James Rohal on July 20, 2021

usepackage[titles]{tocloft}

Quoted the tocloft manual:

The titles option causes the titles of the ToC, LoF, and LoT lists to be typeset using the default LATEX methods. This can be useful, for example, when the tocloft and fncychap packages are used together and the ‘fancy’ chapter styles should be used for the ToC, etc., titles.

Answered by WiseFrog on July 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP