2

I have problem with creation of table contents. A part of my code:

\documentclass[a4paper]{amsbook}
\usepackage[cp1250]{inputenc}
\usepackage{polski}
\makeatletter
\renewcommand*\@seccntformat[1]{\csname the#1\endcsname.\enspace}
\makeatother
\usepackage[sf,bf,outermarks]{titlesec} 

\begin{document}
\tableofcontents
\chapter*{Introduction}
\chapter{(Chapter 1 - Title)}
\section{Section  - Title}
\section{Section  - Title}
\subsection{Subsection - Title}
\subsection{Subsection - Title}
\section{Section  - Title}
\section{Section  - Title}
\section{Section  - Title}
\subsection{Subsection - Title}
\subsubsection{Subsection - Title}
\subsubsection{Subsection - Title}
\subsection{Subsection - Title}
\subsection{Subsection - Title}
\section{Section  - Title}
\begin{thebibliography}{1}
\bibitem{1} Bibliography 1
\end{thebibliography}
\end{document}

and it shows like this enter image description here as you can see, text overlapping.

How can I change this?
How can I add the number of chapter before number of section?

[ Chapter 1. Title
1.1 Section title
1.2 Section title
.... Chapter 2. Title
2.1 Section title
2.2 Section title
...]

4

you are using amsbook. admittedly, the implementation of tables of contents is faulty. leaving aside the reasons for that (fixing it is something that is in the list for the next upgrade, which unfortunately hasn't been scheduled yet), the ams has a package that will allow you to adjust the format to something more suitable.

since the package is not publicly posted, please send a message to tech-support@ams.org requesting it.

the package is not what we would call "industrial strength", and the methods used are not how the problems should be fixed when incorporated directly into amsbook. for these reasons, it is made available only on request.

  • Is the "faulty ToC implementation" also true for other AMS document classes? – lockstep Jun 12 '11 at 14:52
  • I found a solution. It's strange but it works, I don’t know why. I compiled the code and I got a table of contents with overlapping text. Then I deleted this part: \usepackage[sf,bf,outermarks]{titlesec} and compiled again. Next I pasted the same part of code, which I deleted before, i.e I compiled the code which I had at the beginning. That solved the problem. (?!) – LiN Jun 12 '11 at 17:00
  • @lockstep -- yes, for all ams document classes. sad but true. – barbara beeton Jun 12 '11 at 21:27
2

Add the following to the preamble:

\makeatletter    
\def\l@subsection{\@tocline{1}{0,2pt}{2pc}{8mm}{\ \ }} 
%% used 0,1 to add vertical space b/w "subsec" and "subsubsec"
%% Used \ (and a space) to add offset for the subsections. Here I added 2 spaces
%% Used 2pc for the nr. of subsubsections in the subsections
%% Used 8mm to add "horizontal space" b/w the "number" and "subsection"

If you replace subsection with section or subsubsection it works for everything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.