# Weird Alignment in TOC

I want to align my TOC, so that the appendices and other appendix type chapters are aligned by the numbers, rather than the start of the chapter headings.

So in the situation below, case A is the default, the A's and B's are not aligned. I would like them aligned as demonstrated in case B.

Does anyone know how to do this?

NB: The red lines are not part of the problem, merely to illustrate the current alignment...

Trying to fish the relevant code out of about 20 pages of other code, this is what I think is the relevant parts. You can see that Appendix is the Same as Exhibit in the sense that they are bot appendixes, but with different chapter names and reset number counters.

\pagestyle{empty}
\cleardoublepage
\setlength{\cftbeforechapskip}{7pt}
\setlength{\cftbeforesecskip}{0pt}
\begin{spacing}{0.9}
\let\orignumberline\numberline
\tableofcontents
\vspace{1em}

\let\chapter=\subsection
\renewcommand{\cftfigfont}{\small Fig }
\listoffigures

\let\chapter=\subsection
\renewcommand{\cfttabfont}{\small Tab }
\listoftables
\end{spacing}


\noappendicestocpagenum
\renewcommand{\appendixtocname}{List of Exhibits}
\renewcommand{\appendixname}{Exhibit}
\renewcommand{\setthesection}{\roman{section}}
\renewcommand{\setthesubsection}{\roman{subsection}}

\begin{appendices}
\setcounter{chapter}{0}
\renewcommand{\thechapter}{\Alph{chapter}}
\renewcommand{\thesection}{\thechapter.\roman{section}}
\renewcommand{\thesubsection}{\thesection.\roman{subsection}}

\chapter{Mathematical Proofs}

%Text Removed Here....
\end{appendices}


\renewcommand{\appendixname}{Appendix}
\begin{appendices}
\setcounter{chapter}{0}
\pagestyle{detailed}
\chapter{Data - The Quick Brown Fox}
\lettrine{D}{ata} Summary Goes Here.
\lipsum[1]
\newpage

\chapter{Data - Jumped Over the Lazy Dog}
\lettrine{D}{ata} Summary Goes Here.
\lipsum[1]
\newpage
\end{appendices}

-
Since such is not the default way the TOC is printed, you should add the code you're using. –  egreg Dec 30 '12 at 14:27
@egreg I have updated the post. –  Nicholas Hamilton Dec 30 '12 at 17:45
are you still interested by this problem? is your class the memoir class? are you using package tocloft? –  user700902 Feb 25 '13 at 18:35
Not memoir class, using book class, using tocloft. –  Nicholas Hamilton Mar 5 '13 at 5:39
@ADP Has there been progress on this question? Could you complete the code to a full MWE? –  Qrrbrbirlbel Mar 14 '13 at 21:27

Here's a possible solution using the titletoc package and \contentspush to add the labels before the numbering, producing the desired alignment:

\documentclass{book}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{appendix}

\noappendicestocpagenum
\renewcommand{\appendixtocname}{List of Exhibits}
\renewcommand{\appendixname}{Exhibit}
\renewcommand{\setthesection}{\roman{section}}
\renewcommand{\setthesubsection}{\roman{subsection}}

\begin{document}
\tableofcontents

\chapter{Regular Chapter One}
\chapter{Regular Chapter Two}

\titlecontents{chapter}
{\contentslabel[\contentspush{\appendixname~\thecontentslabel}]{0.6em}}
{\hspace*{-0.6em}}{\hfill\contentspage}
\renewcommand\thesection{\thechapter.\roman{section}}
\begin{appendices}
\chapter{Mathematical Proofs}
\section{Euler's Formula}
\section{de Moivre's Theorem}
\end{appendices}

\renewcommand{\appendixname}{Appendix}

\titlecontents{chapter}
{\contentslabel[\contentspush{Appendix~\thecontentslabel}]{0.6em}}
{\hspace*{-0.6em}}{\hfill\contentspage}
\begin{appendices}
\setcounter{chapter}{0}
\chapter{Data - The Quick Brown Fox}
\chapter{Data - Jumped Over the Lazy Dog}
\end{appendices}

\end{document}


Changes to the entries font are easy and were not the core of this question, so I didn't do them.

-