1

I have a document of class book, and I have several chapters and sections in this document. Additionally, I group several chapters under one part, so I call \part to do this. At the end of my document, I have the appendices, which I start with \appendix. There are several chapters, and I would like to do the same here: to group them into a 'part' called Appendices.

So I call \part*{Appendices}. However, in the ToC, this entry contains the word 'Part'. I would like to know what I can do to remove that single word 'Part' for that single entry.

Thank you,

Below is an example MWE

\documentclass[12pt,a4paper,oneside,openany]{book}



% *** FONTS AND TYPESETTING PACKAGES ***
%
\usepackage{titlesec}
\usepackage{titletoc}



% *** PAGE FORMATTING PACKAGES ***
%
\usepackage{appendix}



%
%% Macros & Preambles
%
%% ToC/LoFT formatting
\titlecontents{part}                     % Section
[0pt]                                    % Left(-indent)
{\vspace{10pt}\filcenter\Large\bfseries} % Before contentslabel
{}                                       % Format for numbered entry
{\partname\ \thecontentslabel}           % Format for unnumbered entry
{}                                       % Filler page format
[\vspace{12pt}]                          % After
%%
\makeatletter
\g@addto@macro\appendix{%
  \addtocontents{toc}{\protect\renewcommand{\protect\partname}{Appendices}}%
}
\makeatother

\titlecontents{chapter}                  % Section
[0pt]                                    % Left(-indent)
{\vspace{6pt}}                           % Before contentslabel
{\bfseries\chaptername\ \thecontentslabel\ } % Format for numbered entry
{\rmfamily\thecontentslabel}             % Format for unnumbered entry
{\titlerule*{.}\contentspage}            % Filler page format
[\vspace{6pt}]                           % After
%%
\makeatletter
\g@addto@macro\appendix{%
  \addtocontents{toc}{\protect\renewcommand{\protect\chaptername}{\appendixname}}%
}
\makeatother

%% Page title-ing
\titleformat{\part}[block]%
{\filcenter\large\bfseries}%
{\partname\ \thepart:\ }%
{5pt}%
{\large}

\titleformat{\chapter}[display]%
{\normalfont\large\bfseries}%
{\vspace*{-40pt} \centering \chaptertitlename\ \thechapter}%
{40pt}%
{\vspace*{-20pt} \centering \large}

\titlespacing*{\chapter}{0pt}{20pt}{20pt}

\titlespacing*{name=\chapter,numberless}{0pt}{0pt}{20pt}
%%



\begin{document}

\frontmatter

%% TABLE OF CONTENTS
\cleardoublepage
{
\tableofcontents
}


\mainmatter

%% PART I
\newpage
\part{Part}


% Chapter II
\newpage
\chapter{Chapter}
{
    \section{Section 1}
    Test

    \section{Section 2}
    Test
}


%% APPENDIX
\appendix
\newpage
\part*{Appendices}


% Appendix A

\newpage
\chapter{Appendix}
{
    Test
}


\end{document}

  • Try using the appendix package after reading the documentation (> texdoc appendix). – Peter Wilson Oct 21 at 17:01
  • My bad, I didn't need to \begin{appendices} at all. I've corrected the MWE. – KaiserHaz Oct 23 at 16:29
  • I did find out that if I called \renewcommand{\partname}{} before \tableofcontents this will remove Part from all ToC entries at that level. I did some reading and found out that \contentsline is called to effectively write the ToC entries. For the entry in which I'm interested, \contentsline's first argument is part, so I'm assuming it's running some low-level code behind to append the correct \partname. – KaiserHaz Oct 23 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.