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*

  • 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) – barbara beeton Aug 1 '14 at 23:31
  • As it stands, the condition inside \fancyhead[R] doesn't do anything. – Werner Aug 2 '14 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 '14 at 9:49
  • @barbarabeeton I apologise for not specifying the document class. I am using the 'report' class. – ekyr Aug 2 '14 at 23:18
  • @egreg I apologise for not specifying the document class. I am using the 'report' class. – ekyr Aug 2 '14 at 23:21
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}
|improve this answer|||||

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.