I've designed a whole new fancy chapter header layout, and have hard coded the word "Chapter" in there before the chapter number. I just realized now that this won't work because I have an appendix named "Chapter A".
Is there a variable that will contain the word Chapter or Appendix depending on which it is typesetting at the moment? \chaptername
only seems to have the word "Chapter" even though I'm using it under the appendix section.
Edit: I've got it working in my chapter headers, thanks to answers below; but my TOC isn't working properly. I've changed my TOC with titletoc
, and it still says "Chapter" even though I've got the following code:
\documentclass{book}
\usepackage{titletoc}
\usepackage{color}
\makeatletter
\titlecontents{chapter}[-2em]
{\color{cyan}\bfseries\LARGE\addvspace{3mm}}
{\@chapapp \contentslabel{-0.25em}\hspace{2em}}
{}
{\hspace{3em}\contentspage}
\makeatother
\begin{document}
\tableofcontents
\chapter{test}
\appendix
\chapter{asdf}
\end{document}
\@chapapp
so you need\makeatletter
and\makeatother
when using it. – egreg Jan 31 '13 at 21:23