0

I am trying to create my table of contents, but I want the text "Appendices" to have the same font size as a part (Investigation). How can I increase the font size? Also, I have tried \addcontentsline{toc}{part}{Appendices}, but that was entitled "Investigation Appendicies" (which...fail...), and I couldn't seem to change the cftpartpresnum at that point. Here is my MWE:

\documentclass[openany]{book}
\usepackage[margin=1in, headheight=4em]{geometry}
\geometry{letterpaper}                  % ... or a4paper or a5paper or ... 

\usepackage{calc}

%% Rename "Part" to "Investigation" and append that label to the table of 
%% contents  
\renewcommand{\partname}{Investigation}
\renewcommand{\chaptername}{Investigation \Roman{part} --- Part}
\renewcommand{\thepart}{\Roman{part}:}
\makeatletter\@addtoreset{chapter}{part}\makeatother%
\usepackage{tocloft}
\renewcommand{\cftpartpresnum}{Investigation }
\let\cftoldpartfont\cftpartfont
\renewcommand{\cftpartfont}{\cftoldpartfont\cftpartpresnum}
\renewcommand{\cftpartaftersnumb}{:}
\setlength{\cftpartnumwidth}{\widthof{\textbf{Investigation \textrm{IV}:}}}
\renewcommand{\cftchappresnum}{Part}
\renewcommand{\cftchapaftersnum}{ -- }
\setlength{\cftchapnumwidth}{\widthof{\textbf{Part B --}}}

\setcounter{tocdepth}{0}

%% Change formatting of the part so that things can be on the same page
\usepackage{titlesec}

\titleclass{\part}{top} % make part like a chapter
\titleformat{\part}[display]{\centering\normalfont\Huge\bfseries}{\partname\ \thepart}{0pt}{\huge}

\usepackage[toc,page,title]{appendix}


%% Remove headers from blank pages
\usepackage{emptypage}

\begin{document}
\frontmatter
\tableofcontents
\chapter*{My maddness}
What can I say, I'm on a Tolkien kick.

\mainmatter
\part{The Hobbit}

\chapter{Bilbo Baggins}
\chapter{Thorin, Oin, Gloin, and the nine}
\chapter{The dragon under the mountain}

\part{The fellowship of the Ring}
\chapter{Frodo}
\chapter{Sam}
\chapter{Merry}
\chapter{Pippin}

\part{The two towers}
\chapter{Gandalf the White}
\chapter{Gimli}
\chapter{Legolas}

\part{Return of the King}
\chapter{Aragorn}
\chapter{Mount Doom}
\chapter{Who cares?}


\appendix

\begin{appendices}
  \chapter{Concerning Hobbits}
  \chapter{Maps}
\end{appendices}

\end{document}

enter image description here

Also, it would be good if the "Part" disappeared before the A and B in the appendix labels. But one problem at a time.

0

I found an answer to this question and applied it here.

  • I removed the appendix package
  • I added the redefinition of the \appendix macro below

    \makeatletter
    \g@addto@macro\appendix{%
      \addtocontents{toc}{%
         \protect\renewcommand{\protect\cftpartpresnum}{}%
         \protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}%
         \protect\setlength{\protect\cftchapnumwidth}{\widthof{\textbf{Appendix B --}}}
      }%
    }
    \makeatother
    

Then I just added this to the end:

\appendix
\addcontentsline{toc}{part}{Appendices}
\chapter{Concerning Hobbits}
\chapter{Maps}

\end{document}

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.