2

I'm wondering whether is possible to have Appendix designed as a chapter with sections in book document class and not as a part with chapters.

This is what I get using appendix package

\documentclass[onesided]{book}

\usepackage[titletoc]{appendix}

\begin{document}
\tableofcontents
\begin{appendices}
\appendixpage
\noappendicestocpagenum
\addappheadtotoc

\chapter{Appendices}
\section{A1 First appendix}
\section{A2 Second appendix}

\end{document}

enter image description here

But I would like to get something like this: enter image description here

1 Answer 1

2

Never, ever type chapter/section numbers manually!

If you have read the appendix documentation, you would know that \appendixpage will create a “part-like” page. So, don’t use it.

Since you are using the standard class: book, there aren’t many hooks we can use. So I proposed the following:

  1. \suppresschapternumber makes the numbered chapter to be typeset as an unnumbered chapter, and it changes how the rest of the chapters are written into the ToC.
  2. \removedotbetweenchapterandsection, well, removes the dot between the chapter letter and the section number.

Use the following with extreme caution!

\documentclass[onesided]{book}

%\usepackage[titletoc]{appendix}

\usepackage{etoolbox}
\makeatletter
\newcommand*\suppresschapternumber{%
  \let\@makechapterhead\@makeschapterhead
  \patchcmd{\@chapter}
    {\protect\numberline{\thechapter}}
    {}
    {}{}%
}
\newcommand*\removedotbetweenchapterandsection{%
  \renewcommand\thesection{\thechapter\@arabic\c@section}%
}
\makeatother

\begin{document}
\tableofcontents

\appendix

\suppresschapternumber
\removedotbetweenchapterandsection

\chapter{Appendices}
\section{First appendix}
\section{Second appendix}

\chapter{More appendices}
\section{First appendix}
\section{Second appendix}

\end{document}

ToC


Appendices


More appendices

2
  • O noticed now one thing - there is bad header in appendices - Appendix A - Appendices instead of desired Appendices. Is it also possible to change it?
    – Adela
    Aug 21, 2018 at 6:16
  • Moreover, when you use hyperref package, this will add letter in TOC before chapter name, e.g. A Appendices
    – Adela
    Aug 21, 2018 at 6:40

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.