[OS X TeX] Re: Shallow table of contents

Alan Munn amunn at gmx.com
Wed May 19 12:22:44 EDT 2010


On May 19, 2010, at 4:24 AM, Ferguson, Don wrote:

> Greetings  "Alan Munn" <amunn at gmx.com>
> On 18/05/2010 at 11:10 you wrote concerning
> Re: [OS X TeX] Shallow table of contents
>
> Hello Alan,
>
> AM>> I am using \documentclass{amsbook} and within it want a table of
> AM>> contents. The current setup includes:
> AM>>
> AM>> A table of contents is produced but it only includes entries for
> AM>> 'chapter' and 'sections'. Would like entries for 'subsections'  
> and
> AM>> 'subsubsections' as well. Since I have read documents which do  
> have
> AM>> the "deeper" table of contents, there must be some way to so  
> specify.
> AM>>
> AM>> So far any docs I've read say nothing about how to include
> AM>> 'subsections' and 'subsubsections'. Where should I be looking and
> AM>> how is it done?
>
>
> AM> The amsbook class is designed to meet the requirements of the  
> AMS, and
> AM> isn't designed to be customised.  I would recommend that you use a
> AM> more general book class such as memoir for your project.
>
> Interesting! Memoir? Okay, I'll try it!
>
>
> AM> That being said, you could add the following to your document  
> preamble
>
> AM> \setcounter{tocdepth}{4} %
> AM> \makeatletter
> AM> \expandafter\def\csname r at tocindent4\endcsname{0pt}
> AM> \makeatother
>
> Setting tocdepth to 4 with {amsbook} had no effect for me.

I don't know what this means.  By itself, it won't do anything. It's  
true that for your purposes, setting it to 3 or 4 won't make a  
difference.  (Setting it to 4 will allow \paragraph{} to be included  
in the table of contents; setting it to 3 goes down to subsubsection.

> However, the part
>
> r at tocindent4
>
> rang a bell.

I'm not sure what this means either.

> On setting tocdepth to 3, I was getting the error message:
>
> ---------
> ./Mechanics.tex:593: Missing number, treated as zero.
> <to be read again>
>                  \r at tocindent4
> l.593  F
>        or any vectors $\mathbf{a,b,x}$:
> -----------
>
> I could find no error in the text that supposedly lodged the  
> complaint.
>

This isn't caused by the code I gave you, but by something else in  
your document. The following minimal document compiles and does  
exactly what you requested, so there's something else going on in your  
document:

\documentclass{amsbook}
\setcounter{tocdepth}{3} %
\makeatletter
\expandafter\def\csname r at tocindent4\endcsname{0pt}
\makeatother
\begin{document}
\tableofcontents
\chapter{A chapter}
\section{A section}
\subsection{A subsection }
\subsubsection{A subsubsection}

\end{document}

Alan



-- 
Alan Munn
amunn at gmx.com







More information about the MacOSX-TeX mailing list