Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
Can you provide a small example that has some \chapter*s together with a ToC? That will help seeing the scope more clearly. See how to create a minimal working example (MWE). –  Werner Mar 8 '13 at 4:27

2 Answers 2

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

share|improve this answer
    
you might want to add dots from text to page number. in the definition of \@tocline in amsbook.cls, there's an \hfil`. that would be replaced by \leaders as in the definition of \@dottedtocline in latex.ltx; some adjustment might be necessary to adjust the amount of space set aside for the page numbers. –  barbara beeton Mar 8 '13 at 16:11
    
@barbarabeeton Yes, I thought about this too, but I am not sure if the OP wants the dots; the drawing in the question suggests that he wants them, but then there's no mention of dots in the description. Anyway, in some time I'll add the code to produce the dotted leaders. –  Gonzalo Medina Mar 8 '13 at 18:05
    
@barbarabeeton option with dots added. –  Gonzalo Medina Mar 8 '13 at 19:35

since you're using amsbook, and it appears that (some of) your chapters have individual authors, you may be able to benefit from the package amsbooka. this is included in tex live (in the same area as amsbook.cls). there's no documentation with the package, but instructions can be found on line, in the ams author faq. (the link will pull up multiple questions; the one you want is enclosed in a red rectangle.)

the package styles the chapter headings as well as the entries in the toc.

like the suggestion by Gonzalo, the toc entries do not include dots, but as he pointed out in a comment, it's not entirely clear that they're required.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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