# Different indentations of same level in ToC

I am writing a paper for university and I need to do it according to style guides. Everything looks peachy, except for the ToC.

This is how it comes out for me:

The word "appendix" shouldn't overlap with the section name, but also the non-appendix subsections cannot be further to the right than they are now. That's why I cannot use

\renewcommand\l@subsection{\@dottedtocline{2}{1.5em}{3em}}


Following is the code I have in my *.cls file which might have some influence in current formatting.

\renewcommand{\section}{%
\@startsection {section}{1}{\z@}
{-3.5ex \@plus -1ex \@minus -.2ex}
{2.3ex \@plus.2ex}
{\normalfont\Large\bfseries}
}

\renewcommand{\l@section}[2]{%
\ifnum \c@tocdepth >\z@
\setlength\@tempdima{1.5em}
\begingroup
\vspace{1.5mm}
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode {
\hskip -\leftskip
\MakeUppercase{#1}}\nobreak\ %
\leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}
\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\endgroup
\fi
}

\renewcommand{\appendix}{%
\renewcommand{\thesubsection}{\arabic{subsection} appendix.}
}


The ToC in the image was generated with following statements:

\section{Section 1}
\section{Section 2}
\subsection{Subsection 2.1}
\section{Appendices}
\appendix
\subsection{Awesome appendix}
\subsection{Not so awesome appendix}


I will be grateful for any help you can provide.

-
Welcome to TeX.sx!! Please add a minimal working example (MWE) that illustrates your problem. –  Marco Daniel Jun 17 '12 at 16:44

You can use the titletoc package to change the formatting for subsection entries just before the appendices; here's an example:

\documentclass{article}
\usepackage{titletoc}

\makeatletter
\renewcommand{\l@section}[2]{%
\ifnum \c@tocdepth >\z@
\setlength\@tempdima{1.5em}
\begingroup
\vspace{1.5mm}
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode {
\hskip -\leftskip
\MakeUppercase{#1}}\nobreak\ %
\leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}
\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\endgroup
\fi
}

\renewcommand{\appendix}{%
\renewcommand{\thesubsection}{\arabic{subsection} appendix.}
}
\makeatother

\begin{document}
\tableofcontents
\section{Section 1}
\section{Section 2}
\subsection{Subsection 2.1}
\section{Appendices}
\appendix

\titlecontents{subsection}
[7.5em]{}
{\contentslabel{6em}}
{\hspace*{-6em}}
{\titlerule*[0.6pc]{.}\contentspage}

\subsection{Awesome appendix}
\subsection{Not so awesome appendix}

\end{document}


In your actual document, all you need to do is to load the package and

\titlecontents{subsection}
[7.5em]{}
{\contentslabel{6em}}
{\hspace*{-6em}}
{\titlerule*[0.6pc]{.}\contentspage}


ust before the subsections corresponding to the appendices.

-
You are a life saver. This is the most correct and cleanest looking answer. Thank you. –  Paulius K. Jun 17 '12 at 17:12

use a modified definiton of \l@subsection:

\documentclass{article}
\begin{document}

\tableofcontents
\section{Section 1}
\section{Section 2}
\subsection{Subsection 2.1}
\section{Appendices}