# Chapter title formatting

I'm working in memoir class and would like to format my chapter headings like this:

The author's name and years of birth-death are at the top, then a horizontal line the length of the above details, then the title, followed by an optional subtitle.

• Which part(s) will appear in the table of contents? which parts in the header (or, footer, though that would be odd)? Is the idea that you will simply end up writing something like \chapter{<author>}{<title>}[<subtitle>] and get that output and everything put in the ToC and header in a standard way? – jon Jan 15 '14 at 1:32
• I want the author and title to be in the table of contents like this: AUTHOR Title Subtitle .... <page number>. Title centered in header and page number centered in footers. And I would like to use the \chapter{<author>}{<title>}[<subtitle>] command as it is. – Medulla Oblongata Jan 15 '14 at 2:10

One possibility would be to implement a 'chapter-like' command in order to get around the requirement that there be two mandatory and one optional argument:

\documentclass[12pt,openany]{memoir}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{etoolbox}
\usepackage{xparse}
\usepackage{bookmark}

\makepagestyle{title}
\makeevenfoot{title}{}{\thepage}{}
\makeoddfoot{title}{}{\thepage}{}
\pagestyle{title}

% the \chapterhead command (partially memoir-dependent)
\makeatletter
{\IfNoValueTF{#3}%
{\clearforchapter
\phantomsection
% \numberline{}% <-- required if 'chapters' are numbered...
\texorpdfstring{\MakeUppercase{#1}}{#1}\space #2}
\markboth{#2}{#2}%
\thispagestyle{chapter}%
\insertchapterspace
\setauthorname{#1}%
\printauthorname
\settowidth{\authornamelength}{#1}%
\afterauthorname
\setmainchaptertitle{#2}%
\printsubtitle
\@afterindentfalse\@afterheading% <-- prevent indentation at start of paragraph
}%
{\clearforchapter
\phantomsection
% \numberline{}%
\texorpdfstring{\MakeUppercase{#1}}{#1}\space #2\space #3}
\markboth{#2}{#2}%
\thispagestyle{chapter}%
\insertchapterspace
\setauthorname{#1}%
\printauthorname
\settowidth{\authornamelength}{#1}%
\afterauthorname
\setmainchaptertitle{#2}%
\setsubtitle{#3}%
\printsubtitle
}%
}
\makeatother

% Auxiliary formatting macros:
\newlength\authornamelength
\newcommand*{\authornamefont}{\normalsize\normalfont}
\newcommand*{\mainchaptertitlefont}{\normalfont\large}
\newcommand*{\subtitlefont}{\normalsize\normalfont}
\newcommand{\afterauthorname}{%
\par\centerline{\parbox{\authornamelength}{\hrulefill}}\par}%

% ARG. #1: Author name
\newcommand*{\setauthorname}[1]{\csdef{authorname}{#1}}
\newcommand{\printauthorname}{{\par\centering
\authornamefont \scshape\MakeLowercase{\csuse{authorname}}\par}}%

% ARG. #2: Title
\newcommand*{\setmainchaptertitle}[1]{\csdef{mainchaptertitle}{#1}}
{\par\centering \mainchaptertitlefont
\MakeUppercase{\csuse{mainchaptertitle}}\par}}

% ARG. #3 (optional): Source
\newcommand*{\setsubtitle}[1]{\csdef{subtitle}{#1}}
\newcommand{\printsubtitle}{%
{\par\centering \subtitlefont
\textit{from} \csuse{subtitle}\par}}

\begin{document}

\tableofcontents

\lipsum

\chapterhead{Marcus Tullius Cicero}{Dream of Scipio}[On the Republic]

\lipsum[2]


• Another reason for xparse would be to make the date 'field' optional as well along the lines of \chapterhead{<author>}[<date>]{<title>}[<subtitle>]... – jon Jan 15 '14 at 17:34