0

I'm setting a document using the octavo class and including the packages tocloft and fancyhdr. Here are my fancyhdr settings:

\fancyhead[CE]{\itshape\booktitle}
\fancyhead[CO]{\itshape\leftmark}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}

I want the chapter numbers to appear in the chapter listing in the TOC, so I'm starting the chapters with e.g.:

\chapter[II. Title of Chapter Two]{Title of Chapter Two}

This gives me the chapter heading I want ("Title of Chapter Two") and the TOC entry I want ("II. Title of Chapter Two"), but the header on every right page is the latter, when I want it to be the former.

Is there a way I can do this?

Thank you for your help!

1 Answer 1

1

The optional argument of \chapter is used for the ToC and \markboth. If you want a chapter title without a number, but a different thing in ToC, and another in the headers, you can use \addcontentsline for the ToC, \chapter* for the not numbered title and set \markboth to have even more title versions at the left and/or right header (even without fancyhdr). This can be simplified with a macro, but I set it manually in two chaptersto make more clear the approach.

Note that no one of these chapter title versions should have the number that will be wrong if you add\remove\move any other chapter. If only should be numbered in ToC, just allow a numbered ToC setting the secnumdepth counter, since \chapter* will be not cumbered anyway.

In the example, the four chapter name versions in the MWE are just repeated characters, AAAA, EEE, etc. instead of titles for humans beings (ugly, but easier to check where is ending each in the PDF):

\documentclass{octavo}
\usepackage{lipsum}

\setcounter{secnumdepth}{1}
\renewcommand{\thechapter}{\Roman{chapter}}

\begin{document}

\tableofcontents

\mainmatter


\chapter*{AAAA\markboth{EEEE}{OOOO}} % Title ≠ even header ≠  odd header ≠ ToC 
\stepcounter{chapter}
\addcontentsline{toc}{chapter}{\numberline{\thechapter} SSSSS}
\lipsum[1-10]

\chapter*{ZZZZ\markboth{XXXX}{CCCC}} % Title ≠ even header ≠  odd header ≠ ToC 
\stepcounter{chapter}
\addcontentsline{toc}{chapter}{\numberline{\thechapter} UUUUU}
\lipsum[1-10]


\end{document}
1
  • Thank you so very, very much! I really appreciate the help—this does everything I wanted it to and more! Jun 19, 2023 at 15:04

You must log in to answer this question.

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