开发者

Add "Appendix" before "A" in thesis TOC

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 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? There is a related question, How to make 'appendix' appear in toc in Latex?, but the answers did not appear t开发者_StackOverflow中文版o help in this case.


You can easily achieve what you want using the appendix package. Here's a sample file that shows you how. The key is the titletoc option when calling the package. It takes whatever value you've defined in \appendixname and the default value is Appendix.

\documentclass{report}
\usepackage[titletoc]{appendix}
\begin{document}
\tableofcontents

\chapter{Lorem ipsum}
\section{Dolor sit amet}
\begin{appendices}
  \chapter{Consectetur adipiscing elit}
  \chapter{Mauris euismod}
\end{appendices}
\end{document}

The output looks like

Add "Appendix" before "A" in thesis TOC

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜