[Tex/LaTex] Problems Customizing TOC in amsbook style

amsbooktable of contents

I am attempting to create a table of contents (in the amsbook document class) with a specific format; however, after several attempts I can't seem to get it to work out. The document will include several articles written by different authors (much like a typical Proceedings of Such-and-Such Conference book) The format I would like to see is:

Chapter Title A ……………………………………………. Page #
Author
Long Chapter Title that wraps around
to the next line ……………………………………………. Page #
Author

The "author " lines should be indented some – I don't know how to indent on this forum..

etc. The important points are that I need \chapter*{}, so that there are no chapter numbers, the page numbers should be aligned with each chapter title, with no additional page number on the "author" line, and the wrapped text for the long chapter title lines up with the beginning of title on the above line (every attempt I've made thus far indents the wrapped text, as if there are chapter numbers preceeding it- I dont want that).

Sorry if this is trivially easy, but I'm not terribly experienced with customizing the table of contents, and I can't seem to get it to work at all.

Best Answer

Here's one possibility: I suppressed the undesired indentation for the entries, and I defined a command \atotoc with a mandatory argument (the name of the author) to add the author information:

\documentclass{amsbook}

\AtBeginDocument{%
\makeatletter
\expandafter\renewcommand\csname r@tocindent0\endcsname{0pt}
\makeatother
}
\newcommand\atotoc[1]{\addtocontents{toc}{#1\par}}

\begin{document}

\tableofcontents
\chapter*{Test Chapter One}
\atotoc{Author One}
\chapter*{Test Chapter Two with a Long Title that will Span Two Lines in the Table of Contents}
\atotoc{Author Two}

\end{document}

An image of the resulting ToC:

enter image description here

If dots between text and page number are required for the entries, some additional work needs to be done:

\documentclass{amsbook}

\makeatletter
\newcommand\@dotsep{4.5}
\def\@tocline#1#2#3#4#5#6#7{\relax
  \ifnum #1>\c@tocdepth % then omit
  \else
    \par \addpenalty\@secpenalty\addvspace{#2}%
    \begingroup \hyphenpenalty\@M
    \@ifempty{#4}{%
      \@tempdima\csname r@tocindent\number#1\endcsname\relax
    }{%
      \@tempdima#4\relax
    }%
    \parindent\z@ \leftskip#3\relax \advance\leftskip\@tempdima\relax
    \rightskip\@pnumwidth plus1em \parfillskip-\@pnumwidth
    #5\leavevmode\hskip-\@tempdima{#6}\nobreak
    \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill
    \nobreak
    \hbox to\@pnumwidth{\@tocpagenum{#7}}\par
    \nobreak
    \endgroup
  \fi}
\makeatother
\AtBeginDocument{%
\makeatletter
\expandafter\renewcommand\csname r@tocindent0\endcsname{0pt}
\makeatother
}
\newcommand\atotoc[1]{\addtocontents{toc}{#1\par}}

\begin{document}

\tableofcontents
\chapter*{Test Chapter One}
\atotoc{Author One}
\chapter*{Test Chapter Two with a Long Title that will Span Two Lines in the Table of Contents}
\atotoc{Author Two}

\end{document}

enter image description here