3

I have headings in all my chapters (on the top corner stating which chapter you are reading), however at the end of my document I have a chapter which is not numbered as my appendix and glossary. For these chapters the heading is the same as the last chapter numbered.

\chapter{Chapter 1}
\chapter*{Chapter 1}

For the first command the heading changes, however for the second command (chapters which are not numbered) it does not change. How can I change the heading for those chapters also?

My heading commands are:

\usepackage{fancyhdr}
\fancyhead[R]{
   \itshape
   \ifnum\value{chapter}>0 \fi \nouppercase
   \leftmark}
\fancyhead[L]{}
\fancyfoot[C]{\thepage}{}
\renewcommand{\headrulewidth}{0pt}

I have added

\chaptermark{...}

under the chapter which are unnumbered. This adds the name of the chapter to the header but I would like to remove the number.

Assuming that Ch 6 is my last chapter, Right now my header reads :

*Chapter 6. Title of chapter 6

Chapter 6. Glossary

Chapter 6. Appendix*

However, I would like to have :

*Chapter 6. Title of chapter 6 (Last chapter)

Glossary

Appendix*

5
  • welcome to the site. we really need more information, at least the document class you are using, since different classes treat starred chapters differently. better still, provide a minimal working example (MWE) Aug 1, 2014 at 23:31
  • As it stands, the condition inside \fancyhead[R] doesn't do anything.
    – Werner
    Aug 2, 2014 at 6:50
  • If you're using the book class, just add \backmatter before the final chapters you don't want to be numbered and use \chapter; but the setting of \fancyhead[R] will require a small change. It's impossible to say more without knowing what class you're using.
    – egreg
    Aug 2, 2014 at 9:49
  • @barbarabeeton I apologise for not specifying the document class. I am using the 'report' class.
    – ekyr
    Aug 2, 2014 at 23:18
  • @egreg I apologise for not specifying the document class. I am using the 'report' class.
    – ekyr
    Aug 2, 2014 at 23:21

1 Answer 1

3

You can emulate what the book class does by the command \backmatter, with some modifications.

\documentclass{report}
\usepackage{fancyhdr}

\newif\ifmainmatter
\mainmattertrue

\makeatletter
\newcommand{\backmatter}{%
  \mainmatterfalse
  \let\@makechapterhead\@makeschapterhead
  \renewcommand{\thechapter}{}%
}
\makeatother

\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{%
   \itshape
   \ifnum\value{chapter}>0 \ifmainmatter
     \chaptername\ \thechapter.\ 
   \fi \fi
   \nouppercase\leftmark
}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}

\begin{document}

\tableofcontents

\chapter{Introduction}

Something\newpage else

\chapter{First}

Something\newpage else

\backmatter

\chapter{Glossary}

Something\newpage else

\chapter{Appendix}

Something\newpage else

\end{document}

You must log in to answer this question.

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