目录中的附录以“章节”为前缀,而不是“附录”

目录中的附录以“章节”为前缀,而不是“附录”

一切都运行良好,只是在目录中,附录的前缀是“章节”而不是“附录”,我不知道是什么控制了这些。

更准确地说,我得到的是:

Chapter 1 Title

Chapter 2 Title

Chapter A Title

Chapter B Title

我希望

Chapter 1 Title

Chapter 2 Title

Appendix A Title

Appendix B Title

这是实际文件但我无法在最小工作示例中重新创建它,并且我得到的最好的示例在目录中没有任何前缀:

\documentclass[11pt]{book}

\usepackage{xcolor} 
\usepackage{makeidx}
\usepackage{hyperref}
\hypersetup{colorlinks,linkcolor={red!50!black}}
\usepackage[titletoc]{appendix}

\makeindex

\begin{document}
%\frontmatter

\Large \textsc{Reasonable Book}

\tableofcontents

\mainmatter
\chapter{One}   
Some text \textbf{indexed}\index{indexed}   
\section{To begin with}
And then some more text.
%\noappendicestocpagenum%What does it do?

\appendixpage
\appendix
\chapter{This is text for the stuff that is needed.}    

\backmatter
\chapter{FDL}
The purpose of this License 

\newpage
\phantomsection
\addcontentsline{toc}{chapter}{Index}   
\printindex
\end{document}

答案1

将此添加到您的序言中:

\usepackage{apptools, etoolbox}

\makeatletter
\patchcmd{\@chapter}{\protect {CHAPTER }}{\ifappendix{APPENDIX }\else{CHAPTER }\fi}{}{}
\makeatother

相关内容