TransWikia.com

Titles, headings, and spacing in tocloft with appendices

TeX - LaTeX Asked by Jon Arnold on May 17, 2021

I am working on a template for my dissertation in order to comply with my school’s format.

I am having a few conflicts between the tocloft,titlesec, and appendix packages:

  1. I want the appendices in the ToC to be labeled "Appendix A: [title]" but the body chapters to be labeled "Chapter 1: [title]", etc.
  2. I want the headings on the appendix pages to be "Appendix A: [title]" but the chapter headings to be labeled "Chapter 1: [title]", etc.

Here’s my MWE:

documentclass[12pt]{report}

usepackage[titles]{tocloft}
renewcommand{cftchapfont}{}% Remove bfseries from section titles in ToC
renewcommand{cftchappagefont}{}% Remove bfseries from section titles' page in ToC
renewcommand{cftchappresnum}{Chapter }
renewcommand{cftchapaftersnum}{:}
newlength{mylen} % a "scratch" length
settowidth{mylen}{Chapter} % extra space for "Chapter " but it seems to want less
addtolength{cftchapnumwidth}{mylen} % add the extra space

usepackage{titlesec}
titleformat{chapter}{bfseriescentering}{CHAPTER thechapter : }{0em}{MakeUppercase}

usepackage[titletoc]{appendix}

begin{document}

tableofcontents

chapter{Introduction}
chapter{Another Chapter}
chapter*{Bibliography}
addcontentsline{toc}{chapter}{Bibliography}

begin{appendices}
    chapter{First Appendix}
    chapter{A Second Appendix}
end{appendices}

end{document}

Thanks for any help!

EDIT: Fixed a spacing issue in ToC lines.

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