0

I wanted the heading to be the authors of each respective chapters instead of its \chaptermark, like the picture displayed below:

enter image description here

This is my code:

\documentclass[12pt,twoside,openright]{memoir}
\usepackage[T1]{fontenc}
\usepackage{lipsum,suffix,fbb}

\makeatletter
\makepsmarks{headings}{%
 \def\chaptermark##1{% 
  \markboth{\MakeLowercase{%
   \ifnum\c@secnumdepth > \m@ne
    \if@mainmatter
     {\scshape\@chapapp}\ {\oldstylenums{\thechapter}}. \ %
    \fi
   \fi
   {\scshape ##1}}}{}}}

\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.5em\mdseries\scshape\protect\scriptsize\normalsize#1}{}{}}
  \addtocontents{toc}{\vskip0pt}%
}  
\makeatother

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

\pagestyle{headings}
\makeevenhead{headings}{\oldstylenums{\thepage}}{\textsc{seminar iv}}{}
\makeoddhead{headings}{}{\leftmark}{\oldstylenums{\thepage}}

\begin{document}

\frontmatter
\tableofcontents

\mainmatter
\pagestyle{headings}

\chapter{Introduction}
\chapterauthor{bertrand einstein}
\lipsum[1-10]

\end{document}

I've tried changing the %\def\chaptermark##1{% to \def\printchapterauthor##1{%. It worked. The headings are now displayed what I wanted it to be. Unfortunately, the author's names in each respective chapter pages are suddenly missing. Please excuse my ignorance, for I am new to LaTeX.

1
  • 1
    The data given to the header is more or less set after \chapter{Introduction}, thus hard to add to it. It might be easier to do something like \ChapterWithAuthor{Title}{Author} and then make sure author is saved in a macro which is then used inside \chaptermark when \ChapterWithAuthor issues \chapter{Title}\chapterauthor{Author}
    – daleif
    Commented Aug 8, 2016 at 8:12

1 Answer 1

2

You can add a \chaptermark call to the author command:

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

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .