# Running head in LaTeX book is wrong

I have a book with 14 chapters, two appendices (each chapter and appendix in a separate file), and a bibliography and index. This is set up as:

Preamble

\mainmatter

include chapters

\appendix

include appendices

\backmatter
\bibliographystyle{plain}
\bibliography{mybibfile}
\small
\printindex


This works fine - except that the running head in the bibliography and index has the title of the last appendix on each odd numbered page. This is clearly wrong. How do I fix this up? I hadn't even noticed this until it was picked up by the proofreaders.

I am using the emptypage.sty file to ensure that empty pages have no running head (as required by my publishers).

I'm using a class file provided by the publishers; the relevant section is

\newdimen\bibindent
\setlength\bibindent{1.5em}
\newenvironment{thebibliography}[1]
{\chapter*{\bibname}%
\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty thebibliography' environment}}%
\endlist}


This looks like it should work, but it doesn't.

-
You don't have to sign with your name since it automatically appears in the lower right corner of your post. And please do consider marking some answers to your questions as as ‘Accepted’ by clicking on the tickmark below their vote count. –  Hendrik Vogt Mar 14 '11 at 13:37

This depends very much on your class file. If you are using the standards book class the definition is:

\newenvironment{thebibliography}[1]
{\chapter*{\bibname}%
\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
:
:


If you are using natbib it again redefine the \bibliography command:

\renewenvironment{thebibliography}[1]{%
\bibsection
:
:


with

\providecommand\bibsection{}
\renewcommand\bibsection{%
\chapter*{\bibname\@mkboth{\MakeUppercase{\bibname}}{\MakeUppercase{\bibname}}}%


In both cases it would give the correct output, but the \pagestyle{empty} turns of the \markboth command. If you point us the you class file we can take look.

Otherwise redefine the \cleardoublepage command to insert the empty page style.

\makeatletter
\renewcommand\cleardoublepage{%
\clearpage
\if@twoside \ifodd\c@page\else
\hbox{}\thispagestyle{empty}%
\newpage\if@twocolumn\hbox{}\newpage
\fi\fi\fi}
\makeatother

-
I'm using a class file provided by the publishers; the relevant section is –  Alasdair Mar 14 '11 at 6:20
@Alasdair Look at the redefinition of \cleardoublepage above –  Danie Els Mar 14 '11 at 7:07
Hmmm... I've deleted the loading of the emptypage style, and added the cleardoublepage definition as above, but I'm still getting the title of the last appendix running above the bibliography and index... I'd have to email you the class file, it's a house style and doesn't seem to be available on the Internet for general download. –  Alasdair Mar 14 '11 at 11:52
I seem to have solved it by inserting \pagestyle{myheadings} \markright{} after the \backmatter command and before the bibliography and index commands. –  Alasdair Mar 14 '11 at 13:03
as others have said, the running heads depend on the document class you're using. in versions of the ams document classes before version 2.20 (august 2004), the definition of \backmatter failed to reset the value of \chaptername, which then persisted into the bibliography and index. that was a bug, but it has been fixed.