如何让目录中的附录后显示“:”。
现在我有
附录A.分类实验
但我想要:
附录 A:分类实验
在序言中我使用:
\usepackage[title,titletoc]{appendix}
\renewcommand{\appendixname}{APPENDIX}
在附录中我使用:
\renewcommand{\thechapter}{\Alph{chapter}}
\titleformat{\chapter}[display]{\normalfont \centering}{APPENDIX \thechapter}{11 pt}{}
\begin{appendices}
\chapter{Details of Classification Experiments}
\end{appendices}
附录中的其他所有内容均按我想要的方式格式化。
以下是 MWE:
\documentclass[11pt, letterpaper]{thesis}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\usepackage[title,titletoc]{appendix}
\renewcommand{\appendixname}{APPENDIX}
\usepackage{etoolbox}
\usepackage{tocloft}
\makeatletter
\renewcommand{\numberline}[1]{%
\@cftbsnum #1\@cftasnum~\@cftasnumb%
}
\makeatother
\addtocontents{toc}{\hfill\ {Page} \par}
\usepackage{titlesec}
\assignpagestyle{\chapter}{fancy}
\titleformat{\chapter}[display]{\normalfont \centering}{CHAPTER \chaptertitlename\ \thechapter}{11 pt}{}
\titleformat{\section}[display]{\normalfont \centering}{}{11 pt}{}
\begin{document}
\addcontentsline{toc}{part}{CONTENTS}
\renewcommand{\tocloftpagestyle}[1]{\def\@cftpagestyle{\thispagestyle{#1}}}
\tocloftpagestyle{empty}
\renewcommand*\contentsname{\centerline{CONTENTS}}
\renewcommand{\cfttoctitlefont}{\normalfont}
\tableofcontents
\newpage
\part*{CHAPTERS}
\addcontentsline{toc}{part}{CHAPTERS}
\chapter{Introduction}
\thispagestyle{fancy}
\renewcommand{\thechapter}{\Alph{chapter}}
\titleformat{\chapter}[display]{\normalfont \centering}{APPENDIX \thechapter}{11 pt}{}
\begin{appendices}
\chapter{Details of Classification Experiments}
\thispagestyle{fancy}
\end{appendices}
\end{document}
答案1
thesis.cls
重新定义默认在章节号后\@chapter
插入句点。.
regexpatch
可以用来替换所有这些实例
\makeatletter
% Replace all "\thechapter ." with "\thechapter" - there's 4 of them in \@chapter
\xpatchcmd*{\@chapter}{\thechapter .}{\thechapter}{}{}\thechapter
\makeatother
\usepackage{regexpatch}
在文档序言中包括后。此外,调用
\addtocontents{toc}{\protect\renewcommand\protect\cftchapaftersnum{:}}
在你的第一个附录之前\chapter
。这重新定义了打印的内容后章节的节号。将其插入到toc
需求\protect
离子中。这是您的完整 MWE:
\documentclass[11pt, letterpaper]{thesis}% http://ctan.org/pkg/thesis
\usepackage{regexpatch}% http://ctan.org/pkg/regexpatch
\usepackage{fancyhdr}% http://ctan.org/pkg/fancyhdr
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\usepackage[title,titletoc]{appendix}% http://ctan.org/pkg/appendix
\renewcommand{\appendixname}{APPENDIX}
\usepackage{tocloft}% http://ctan.org/pkg/tocloft
\makeatletter
\renewcommand{\numberline}[1]{%
\@cftbsnum #1\@cftasnum~\@cftasnumb%
}
\makeatother
\addtocontents{toc}{\hfill\ {Page} \par}
\usepackage{titlesec}% http://ctan.org/pkg/titlesec
\assignpagestyle{\chapter}{fancy}
\titleformat{\chapter}[display]{\normalfont \centering}{CHAPTER \chaptertitlename\ \thechapter}{11 pt}{}
\titleformat{\section}[display]{\normalfont \centering}{}{11 pt}{}
\begin{document}
\addcontentsline{toc}{part}{CONTENTS}
\renewcommand{\tocloftpagestyle}[1]{\def\@cftpagestyle{\thispagestyle{#1}}}
\tocloftpagestyle{empty}
\renewcommand*\contentsname{\centerline{CONTENTS}}
\renewcommand{\cfttoctitlefont}{\normalfont}
\tableofcontents
\newpage
\part*{CHAPTERS}
\addcontentsline{toc}{part}{CHAPTERS}
\chapter{Introduction}
\thispagestyle{fancy}
\renewcommand{\thechapter}{\Alph{chapter}}
\titleformat{\chapter}[display]{\normalfont \centering}{APPENDIX \thechapter}{11 pt}{}
\makeatletter
\xpatchcmd*{\@chapter}{\thechapter .}{\thechapter}{}{}%{\typeout{success}}{\typeout{failure}}
\makeatother
\addtocontents{toc}{\protect\renewcommand\protect\cftchapaftersnum{:}}
\begin{appendices}
\chapter{Details of Classification Experiments}
\thispagestyle{fancy}
\end{appendices}
\end{document}