3

I need to place the individual chapter author name above the chapter title.

\@afterheading is used to place the author name after chapter title. I will try to use \@beforeheading% alternatively. But the macro is not running. Please advice how to place the author name before the chapter title both toc and chapter opening page.

MWE:

\documentclass[12pt]{book}
\usepackage{lipsum}

\usepackage{suffix}

\newcommand\chapterauthor[1]{\authortoc{#1}\printchapterauthor{#1}}
\WithSuffix\newcommand\chapterauthor*[1]{\printchapterauthor{#1}}

\makeatletter
\newcommand{\printchapterauthor}[1]{%
  {\parindent0pt\vspace*{-25pt}%
  \linespread{1.1}\large\scshape#1%
  \par\nobreak\vspace*{35pt}}
  \@afterheading%
}
\newcommand{\authortoc}[1]{%
  \addtocontents{toc}{\vskip-10pt}%
  \addtocontents{toc}{%
    \protect\contentsline{chapter}%
    {\hskip1.3em\mdseries\scshape\protect\scriptsize#1}{}{}}
  \addtocontents{toc}{\vskip5pt}%
}
\makeatother

\begin{document}
\tableofcontents

\chapter{1st chapter}
\chapterauthor{K.DINESH KUMAR}
\lipsum[1]

\end{document} 

Required Output: enter image description here

enter image description here

2

I would suggest defining a new command for such headings taking two arguments: the title and the author. The macro should essentially just call \chapter with the author followed by the title, but wrapped into appropriate formatting commands to suit your needs. For example:

Sample output

\documentclass[12pt]{book}

\usepackage{lipsum}

\newcommand\chapterauthor[1]{\authortoc{#1}\printchapterauthor{#1}}

\newcommand{\printchapterauthor}[1]{%
  {\textnormal{\large\scshape#1}\\[2ex]}}

\newcommand{\authortoc}[1]{%
  \addtocontents{toc}{\vskip-10pt}%
  \addtocontents{toc}{%
    \protect\contentsline{chapter}%
    {\hskip1.3em\mdseries\scshape\protect\scriptsize#1}{}{}}
  \addtocontents{toc}{\vskip5pt}%
}

\newcommand{\chapterwithauthor}[2]{\chapter[#1]{\printchapterauthor{#2}#1}\authortoc{#2}\markboth{#2}{#1}}

\begin{document}
\tableofcontents

\chapterwithauthor{1st chapter}{K.~DINESH KUMAR}
\lipsum[1-10]


\end{document}
  • Your solution is working good. – Vetri Sep 4 '17 at 8:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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