I have a thesis (book-class document) with several chapters and appendices. I am using titletoc and titlesec to format the chapter headings and table of contents. When I create an appendix the title formatting of the appendix has the word "Appendix" as expected, but the same item in the table of contents has the word "Chapter" instead. I cannot figure out why my code is returning the word "Chapter" and not "Appendix" in the table of contents. Does anyone know how to get the word "Appendix" instead of "Chapter" in the table of contents?
\documentclass[letter,12pt]{book}
\usepackage{titlesec}
\usepackage{titletoc}
% Chapter title formatting
\titleformat{\chapter} % command
[display] % shape
{\filcenter} % format
{\MakeUppercase{\chaptertitlename} \thechapter \vspace{1em}} % label
{0pt} % separation
{\MakeUppercase} % before code
% Chapter table of contents formatting
\titlecontents{chapter} % section name to be formatted
[1in] % distance from left margin
{} % code for formatting before the entry
{\contentslabel[\MakeUppercase{\chaptertitlename}~\thecontentslabel]{7em}\uppercase} % format when the chapter has a number
{} % format when the chapter has no number
{\titlerule*[1ex]{.}\contentspage} % format for the filler (leader line) and page number
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{An Example Chapter}
To be or not to be, that is the question...
\chapter{Another Example Chapter}
Whether tis nobler in the mind to suffer the slings and arrows of outrageous fortune...
\appendix
\chapter{The First Appendix}
Note that the chaptername command returns \chaptername~while the appendixname command returns \appendixname~and the chaptertitlename command returns \chaptertitlename~but this behavior does not seem to be preserved in the table of contents.
\end{document}