I used

\setcounter{tocdepth}{2}


This actually works fine, almost. The table of contents is showing subsections as well, but these are not pushed forward below the dominating section names. The list of sections and subsections is aligned to the left with the same margin.

Is there a way to fix it?

-
What document class are you using? – Werner Aug 30 '12 at 2:29
@Werner, amsbook. – kloop Aug 30 '12 at 2:31

Change the values used in \@tocline for \l@subsection:

\documentclass{amsbook}

\setcounter{tocdepth}{2}
\makeatletter
\def\l@subsection{\@tocline{2}{0pt}{2.5pc}{5pc}{}}
\makeatother

\begin{document}

\tableofcontents

\chapter{Test Chapter}
\section{Test Section}
\subsection{Test Subsection}
\end{document}


The original definition in amsbook.cls is

\def\l@subsection{\@tocline{2}{0pt}{1pc}{5pc}{}}


and the syntax for \@tocline is

\@tocline{<level>}{<space above>}{<indent from left margin>}{<hang indent>}{<font attributes>}