14

I am using the book LaTeX class and I want to add appendices. I do this in the following way:

\usepackage{appendix}

\appendix
\appendixpage
\noappendicestocpagenum
\addappheadtotoc

\chapter{Some title}
%...

My problem with this is that the \chapter seems to be taken as \chapter*. Because instead of Appendix A. Some title (which is what I want) the appendix that is just titled Some title.

Any idea how I can get the "Appendix A" in front of it? I though this would standard behaviour in the book class. Possibly some other package is messing things up. For instance, I use titlesec, hyperref and cleveref.

Edit: clarification, I am talking about both the title in the text AND the ToC. Neither shows "Appendix A".

Matthias
  • 4,051

2 Answers2

11

The problem turned out to be caused by the fact that I had put \backmatter before \appendix. Putting \backmatter after the appendices solves the problem entirely.

It also turned out this problem had already been solved here: Numbering of appendices in the backmatter of a book

Matthias
  • 4,051
7

I'm not quite sure if I correctly understood your request. But try the following to get "Appendix A" in front of your entries in the ToC.

\documentclass{book}

\usepackage[titletoc]{appendix}

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

\chapter{Some title}
Some text
\end{appendices}
\end{document}

ToC:

enter image description here

Title in text:

enter image description here

Thorsten
  • 12,872
  • 2
    With this setup, you get a line in the ToC labelled "Appendices" followed by "Appendix A Some Title". It may be better to replace the \begin{appendices} and \end{appendices} commands with a single \appendix instruction (while leaving the \appendixpage, \noappendicestocpagenum, and \addappheadtotoc instructions in place. This way, the entries for the individual appendix sections in the ToC will look like "A Some Text". A second advantage of using \appendix is that cleveref's \cref command will replace the prefix "section" with "appendix", which is probably what the OP wants. – Mico Dec 06 '11 at 10:53
  • @Mico Yes, I know, that you get "Appendix A Some title". The image above shows the ToC. I understand the OP's request in a way that he wants to change the title formatting in the ToC. – Thorsten Dec 06 '11 at 10:59
  • OK, maybe I misunderstood the OP's request -- I thought he wanted "Appendix A" to show up at the start of the section. Upon re-reading the OP's question, I'd say your interpretation seems closer to the mark. – Mico Dec 06 '11 at 11:10
  • @Mico: you were both right. My problem is that "Appendix A" is shown neither in the text nor in the ToC – Matthias Dec 06 '11 at 13:18
  • @Matthias But if you compile my code, there is "Appendix A" in the ToC and in the title in text. – Thorsten Dec 06 '11 at 13:37
  • @Thorsten: I in corporated your code in my document, but I get a different result. In the ToC I get: "Appendices\Appendix Some title". But in the text the section is just titled with "Some title". I guess some pother package is inferring. – Matthias Dec 06 '11 at 13:48
  • @Matthias But if you compile only my code you get the same result as I posted above? If this is the case it would be the best if you'd edit your question and complete the MWE. – Thorsten Dec 06 '11 at 13:52
  • @Thorsten: Sorry, I should have done that first. Your code works if I compile it separately. Thanks. I will try to construct an MWE that exposes my problem. – Matthias Dec 06 '11 at 14:04
  • I found the problem :). It was caused by \backmatter which I had put in front of appendix, instead of after it. – Matthias Dec 06 '11 at 14:09
  • 1
    @Matthias Nice to hear this :) Also have a look at http://tex.stackexchange.com/questions/1884/numbering-of-appendices-in-the-backmatter-of-a-book. Especially Caramdir's answer. – Thorsten Dec 06 '11 at 14:16