9

I used AMS LaTeX template with gsm-l package to write my teacher's book.

The table of content that produced has the following form:

enter image description here

in which 1, 2, 3.... are sections and 3.1, 3.2, 4.1, 4.2,.... are the subsection.

I want to indent the subsection with respect to the section, like this (it's ok without dots, though):

enter image description here

1
  • For the future, it's best if you can provide a complete MWE as part of your question
    – cmhughes
    May 15, 2014 at 17:24

2 Answers 2

10

The class gsm-l is based on amsbook and subsection entries in the ToC are typeset according to \l@subsection from amsbook with definition:

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

The third mandatory argument for \@tocline controls the indent for the entries; change 1pt to 2.5pc (or to the value that suits your needs):

\documentclass{gsm-l}

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

\begin{document}

\tableofcontents
\chapter{Test chapter}
\section{Test section}
\subsection{Test subsection}
\subsection{Test subsection}
\section{Test section}
\subsection{Test subsection}
\subsection{Test subsection}

\end{document}

enter image description here

Perhaps you might also want to change the fourth argument (controlling the hanging indentation for entries spanning more than one line), so perhaps

\def\l@subsection{\@tocline{2}{0pt}{2.5pc}{4pc}{}}

could also be a sensible redefinition.

3

FWIW, I use subsubsections in my writing and the currently accepted answer doesn't behave as one would like when there are additional indentations that need to be made.

If you're in the same boat as me, use this code to make subsubsections be indented beyond subsections in the ToC!

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .