16

I am required to insert the word Appendix before the letter A in my dissertation Table of Contents as follows:

Appendix A (title for appendix A)

but the latex thesis cls file: FAU Thesis Class I use generates only the letter A followed by the appendix title:

A (title for appendix A)

The thesis cls file defines a "backmatter" command and the appendix is treated as a chapter.

\newcommand\backmatter{\appendix
\def\chaptermark##1{\markboth{%
\ifnum  \c@secnumdepth > \m@ne  \@chapapp\ \thechapter:  \fi  ##1}{%
\ifnum  \c@secnumdepth > \m@ne  \@chapapp\ \thechapter:  \fi  ##1}}%
\def\sectionmark##1{\relax}}

Is there a simple fix to the above code that will add the word Appendix before the letter A in the TOC for Appendix A? Some related questions have been posted but the answers did not appear to work in this case.

14

Add the following to your preamble:

\usepackage[titletoc]{appendix}
\makeatletter
\renewcommand\backmatter{
    \def\chaptermark##1{\markboth{%
        \ifnum  \c@secnumdepth > \m@ne  \@chapapp\ \thechapter:  \fi  ##1}{%
        \ifnum  \c@secnumdepth > \m@ne  \@chapapp\ \thechapter:  \fi  ##1}}%
    \def\sectionmark##1{\relax}}
\makeatother

The appendix package adds some extra functionality for dealing with appendices. This extra functionality (including the one you need) is accessed by using the \appendices environment instead of the \appendix command. So changing your thesis class \backmatter command to remove the \appendix command, along the with [titletoc] option of the package (which appends the appendix name to the letter in the TOC) should solve your problem.

Now in your actual thesis tex file you should do the following:

\backmatter
\begin{appendices}
\chapter{An appendix}
...
\end{appendices}
\bibliography{}
  • The suggestion worked except that now the word "Appendix" also appears in front of Bibliography as well. – Carey Apr 17 '11 at 3:09
  • No, it shouldn't. I've edited my answer from the very first one I posted. Try the code again with the current version of the answer. I.e. make sure that the redefined \backmatter command does not contain any kind of \appendix command. (And remove your aux files.) – Alan Munn Apr 17 '11 at 3:17
  • Works like a charm! Thank you for your help!! – Carey Apr 17 '11 at 4:55
  • @Carey For others, you should still add a link to the actual class file. – Alan Munn Apr 17 '11 at 4:56
  • I had a similar goal but didn't have \backmatter (\appendix instead)defined in my .cls so I tried to changed \backmatter to \appendix. It gave "Appendix" before the chapter names but I lost the lettering and it returned to numbering like the regular chapters. Instead I was able to \usepackage[title,titletoc]{appendix} and then insert \appendices before the appendix chapter headings. I assume this is a more general solution? or maybe I just got lucky. – Dominik Apr 25 '11 at 18:52
0

Sometimes the simplest solution is the most successful one.

Remove your \newcommand. Instead, \documentclass[appendixprefix=Appendix]{yourDocumentClass} should do the job just fine. (Of course, replace yourDocumentClass with whatever document class you are using.)

Note that you'll need to use a KOMA-script document class. You should, however, be able to make said KOMA-script class fit your requirements, unless you have some very exotic ones.

  • 1
    Where is \appendixprefix comming from? – Johannes_B Dec 3 '17 at 10:07
  • Oops, I misread the docs. That's not a command, that's an option for \documentclass. Will fix right now. – Egor Hans Dec 3 '17 at 10:10
  • This will only work for KOMA-script clsses. The OP mentions a different class. – Johannes_B Dec 3 '17 at 10:31
  • @Johannes_B Thanks for pointing that out. I don't quite understand what reasons there could be against switching to a KOMA-script class, though, as they cover pretty much everything one could need. – Egor Hans Dec 3 '17 at 10:34
  • 1
    Not everyone is fond of KOMA... your suggestion does not work for other classes – user31729 Dec 3 '17 at 11:00

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.