Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How do I get a ":" to show up after Appendix in my ToC.

Right now I have

APPENDIX A. Classification experiments

but I want:

APPENDIX A: Classification experiments

In the preamble I am using:

\usepackage[title,titletoc]{appendix}
\renewcommand{\appendixname}{APPENDIX} 

At the appendix I am using:

\renewcommand{\thechapter}{\Alph{chapter}}
\titleformat{\chapter}[display]{\normalfont \centering}{APPENDIX \thechapter}{11 pt}{}

\begin{appendices}

\chapter{Details of Classification Experiments}

\end{appendices}

Everything else with the appendices is formatted the way I want.

Here's a 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}
share|improve this question
    
That will depend on which class and package you use. Please provide us with a complete, minimal working example (MWE). –  Sveinung Aug 3 '12 at 17:06
    
I am using the thesis package –  COM Aug 3 '12 at 17:28
add comment

1 Answer

thesis.cls redefines \@chapter which inserts a period . after the chapter number by default. regexpatch can be used to replace all of these instances with

\makeatletter
% Replace all "\thechapter ." with "\thechapter" - there's 4 of them in \@chapter
\xpatchcmd*{\@chapter}{\thechapter .}{\thechapter}{}{}\thechapter
\makeatother

after including \usepackage{regexpatch} in the document preamble. Additionally, calling

\addtocontents{toc}{\protect\renewcommand\protect\cftchapaftersnum{:}}

before your first appendix \chapter. This redefines what's printed after the sectional number for chapters. Inserting this into the toc requires \protection. Here's your complete MWE:

enter image description here

\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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.