## LaTeX forum ⇒ Document Classes ⇒ Document class for edited book?

Information and discussion about specific document classes and how to create your own document classes.
vietnamica
Posts: 21
Joined: Thu Nov 19, 2009 6:00 am

### Document class for edited book?

Hello:
I am preparing an edited book with my MikTeX 2.7. Usually, I use the book class. But \def\chaptername{}' and \def\thechapter{}' are not enough for my design of table of contents.

I want the table of content is as follows:

[title of chapter 1]
[the authors].................. 10
[title of chapter 2]
[the authors].................. 20
....

and the beginning of each chapter is as follows:
[title of chapter]
[the authors]
--bodytex--

Thank you very much for your supports and guides.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Hi,

the following code can give you some ideas to help you solve your problem. I defined the command \chapaut with a mandatory argument. The command must be used right after the \chapter commands; the mandatory argument will be used for the names of the authors of the corresponding chapter. The command includes the names after the chapter name and also includes the names in the ToC. I also used the titlesec and titletoc packages to fine tune the chapter headings and the ToC entries.


Of course, feel free to modify my example according to your needs.
1,1,2,3,5,8,13,21,34,55,89,144,233,...

vietnamica
Posts: 21
Joined: Thu Nov 19, 2009 6:00 am
Thank you very much gmedina. It works well. Then how can I align chaptertitle (in the body text) in center as well as change the font of chaptertitle?

I tried the followings but it presents no good.
\begin{center}\chapter{The first}\chapaut{{\it 1st author \& 2dn author}}\end{center}

vietnamica
Posts: 21
Joined: Thu Nov 19, 2009 6:00 am
\titleformat{\chapter}[display]   {\normalfont\huge\bfseries\filcenter}{}{20pt}{\Huge}[\addvspace{5pt}]     \titlespacing*{\chapter}     {0pt}{10pt}{0pt}\titlecontents{chapter}   [0pt]{\addvspace{10pt}}{\bfseries}{\bfseries}{}

The \filcenter solves my problem. Thank you all.

gvw0139
Posts: 1
Joined: Tue Mar 13, 2018 12:25 am
This solution works fine, but if faces a problem for me: in the TOC I only want the title of the chapter and its author, not the (sub)sections in the paper. If I add the command \setcounter{tocdepth}{0}, the (sub)sections disappear from the TOC, as required, but so does the chapter author name. Is there a way of getting rid of (sub)sections in the TOC while keeping the author name?

rais
Posts: 170
Joined: Sun Nov 16, 2014 8:51 pm
gvw0139 wrote:Is there a way of getting rid of (sub)sections in the TOC while keeping the author name?

simply shift the authors-entry to chapter level
\makeatletter   \newcommand*\l@authors{\@dottedtocline{0}{0pt}{0pt}}\makeatother

then the authors won't disappear from TOC with tocdepth set to 0.
Or, if you later want two versions, say one with authors in TOC and one without, leave \l@authors on level 1, shift the entry level for section to 2 and set tocdepth to 1 for keeping the authors in TOC:

KR
Rainer