Page LayoutFormatting the amsart table of contents...

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Starx
Posts: 1
Joined: Thu Oct 21, 2010 6:20 am

Formatting the amsart table of contents...

Post by Starx »

Currently the amsart document class doesn't indent anything in the table of contents. I'd like it to indent subsections from sections to make it more readable but I'm not sure how.

I've seen tocloft suggested several times but it doesn't seem to work with the amsart document class; I get a few hundred errors about missing or extra braces. The fix suggested for this was to use the article document class and include the amsmath, amsthm, etc. packages as needed. But this changes the formatting of the entire document! :(

Is there any way to change the TOC in amsart without changing the rest of the document?

On a similar note is there any way to center this table vertically on the page? Inserting vspace commands has no effect.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cdoss
Posts: 1
Joined: Wed Jan 26, 2011 11:46 pm

Re: Formatting the amsart table of contents...

Post by cdoss »

Bump -- I have identical concerns. Getting missing brackets with amsart and tofcloft, and the table of contents won't indent at all normally.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Formatting the amsart table of contents...

Post by frabjous »

This is why I don't use the AMS document classes if I can avoid it.

It's a strange decision, however -- why choose an AMS document class unless you were submitting to an AMS journal or conference, in which case, you'd just need to follow their formatting anyway?

But certainly you can mimick AMS style with a combination of other packages: geometry for setting the margins, titlesec for changing section and subsection titles, fancyhdr for changing the headers/footers, etc.

But I guess the key question is: what is it in particular about the way amsart works that you want to keep? Why should it be a problem if the formatting changes? LaTeX is designed to separate form and content, after all, so why should it matter if the formatting changes? What are you losing that you want to keep?

But there may be a way to customize how amsart works. I'll try to see if I can figure it out.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Formatting the amsart table of contents...

Post by frabjous »

All right, this seems to work:

Code: Select all

\documentclass{amsart}
\setcounter{tocdepth}{3}% to get subsubsections in toc

\let\oldtocsection=\tocsection

\let\oldtocsubsection=\tocsubsection

\let\oldtocsubsubsection=\tocsubsubsection

\renewcommand{\tocsection}[2]{\hspace{0em}\oldtocsection{#1}{#2}}
\renewcommand{\tocsubsection}[2]{\hspace{1em}\oldtocsubsection{#1}{#2}}
\renewcommand{\tocsubsubsection}[2]{\hspace{2em}\oldtocsubsubsection{#1}{#2}}

\begin{document}
\tableofcontents
\section{My Section}
\subsection{My Subsection}
\subsubsection{My first subsubsection}
\subsubsection{Another subsubsection}

\end{document}
Change the numbers 0em, 1em, 2em, etc., to whatever indent amounts you want.

The starred version of \vspace* should affect its vertical placement if you really want to.
Post Reply