Document Classes ⇒ Document class for edited book?
-
- Posts: 21
- Joined: Thu Nov 19, 2009 6:00 am
Document class for edited book?
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.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Document class for edited book?
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.
Code: Select all
\documentclass{book}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{lipsum}% just to generate some text
\makeatletter
\newcommand*\l@authors{\@dottedtocline{1}{0pt}{0pt}}
\makeatother
\newcommand\chapaut[1]{%
\addcontentsline{toc}{authors}{#1}%
{\bfseries#1}\vskip35pt}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{}{20pt}{\Huge}[\addvspace{5pt}]
\titlespacing*{\chapter}
{0pt}{10pt}{0pt}
\titlecontents{chapter}
[0pt]{\addvspace{10pt}}{\bfseries}{\bfseries}{}
\begin{document}
\tableofcontents
\chapter{Test chapter one}
\chapaut{The name of the first author, The name of second author and The name of the third author}
\lipsum[1-20]
\chapter{Test chapter two}
\chapaut{The First author and The second author}
\lipsum[1-20]
\end{document}
-
- Posts: 21
- Joined: Thu Nov 19, 2009 6:00 am
Document class for edited book?
I tried the followings but it presents no good.
Code: Select all
\begin{center}
\chapter{The first}
\chapaut{{\it 1st author \& 2dn author}}
\end{center}
-
- Posts: 21
- Joined: Thu Nov 19, 2009 6:00 am
Document class for edited book?
Code: Select all
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries\filcenter}{}{20pt}{\Huge}[\addvspace{5pt}]
\titlespacing*{\chapter}
{0pt}{10pt}{0pt}
\titlecontents{chapter}
[0pt]{\addvspace{10pt}}{\bfseries}{\bfseries}{}
Document class for edited book?
Document class for edited book?
simply shift the authors-entry to chapter levelgvw0139 wrote:Is there a way of getting rid of (sub)sections in the TOC while keeping the author name?
Code: Select all
\makeatletter
\newcommand*\l@authors{\@dottedtocline{0}{0pt}{0pt}}
\makeatother
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:
Code: Select all
\setcounter{tocdepth}{1}
\makeatletter
\newcommand*\l@authors{\@dottedtocline{1}{0pt}{0pt}}
\renewcommand*\l@section{\@dottedtocline{2}{0pt}{0pt}}
\makeatother
Rainer