2

I have a thesis written in LaTeX. I've just switched over to natbib as it offered some nice commands but I'm starting to run into some trouble. This one is minor I guess, but I have headers, with the chapter name and page number on. They are implemented in the .cls file like so:

\def \@oddhead{\normalfont \rmfamily \slshape \hfill \leftmark \hfill \thepage}% writes chapter (not sec) at top.

for a normal page, and

\def \ps@chapHeadings{\def \@oddhead{\hfill \textit{\thepage}}}

for a new chapter page.

Now the reference pages have the headings written all capitals. I don't like this as it's inconsistent with the way the rest of the thesis is done.

Does any one know how to sort it?

  • The chapter name is written in \leftmark, which is probably made \MakeUppercase{...} (or \uppercase) somewhere. You do not show this code, but I would suspect removing it would remove the capatilization. – Werner Sep 8 '11 at 15:41
  • @Werner: natbib defines \@mkboth with \MakeUppercase – Marco Daniel Sep 8 '11 at 16:04
4

Add the following lines to your preamble:

\makeatletter
\renewcommand\bibsection{%
      \chapter*{\bibname\@mkboth{\bibname}{\bibname}}}
\makeatother

You should use biblatex instead of natbib. It provides the same commands but it is more flexible.

Here a full working example and it works well:

\documentclass{book}
\usepackage{lipsum}
\usepackage{natbib}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{test,
author={John Smith},
title={TITLE},
year={2011},
publisher={\lipsum\lipsum},
}
\end{filecontents*}
\makeatletter
\def\@oddhead{\normalfont \rmfamily \slshape \hfill \leftmark \hfill \thepage}%
\def\@evenhead{\normalfont \rmfamily \slshape \hfill  \thepage \hfill \rightmark}
 \renewcommand\bibsection{%
      \chapter*{\bibname\@mkboth{\bibname}{\bibname}}}
\makeatother
\begin{document}

\nocite{test}
\bibliography{\jobname.bib}
\bibliographystyle{plainnat}
\end{document}  

Here a small extension to list the references in the table of contents:

\makeatletter
%not numbered
 \renewcommand\bibsection{%
      \chapter*{\bibname\@mkboth{\bibname}{\bibname}}
      \addcontentsline{toc}{chapter}{\bibname}%
      }
%numbered
% \renewcommand\bibsection{%
%      \chapter{\bibname}\@mkboth{\bibname}{\bibname}
%      }
\makeatother
  • @Werner: Now you can edit my post ;-) – Marco Daniel Sep 8 '11 at 15:38
  • This doesn't appear to work right. It replaces the heading with "ReferencesmkbothReferencesReferences" and then write "Conclusions" for the header, which is the previous chapter title. – aghsmith Sep 8 '11 at 15:48
  • I tried biblatex, but it didn't seem to work properly. I have a 253 page document. It threw up abotu 120 errors with unhelpful error messages and told me that most of my bibtex references had problems with them (warnings) – aghsmith Sep 8 '11 at 15:49
  • @aghsmith: I edited my post. Normally biblatex can simple replaced What do to to switch to `biblatex. – Marco Daniel Sep 8 '11 at 16:03
  • Well done sir, some fine hackery. Actually it might have been the \makeatletter command that I kind of knew about... I also added this, which i found on another site, to put references in the contents: \let\oldbibsection\bibsection \renewcommand{\bibsection}{\oldbibsection\addcontentsline{toc}{part}{References}} I just added it after, I'm sure it could have been combined some how though. – aghsmith Sep 8 '11 at 16:40

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.