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?

Werner
  • 603,163
aghsmith
  • 2,716
  • 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 08 '11 at 15:41
  • @Werner: natbib defines \@mkboth with \MakeUppercase – Marco Daniel Sep 08 '11 at 16:04

2 Answers2

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
Marco Daniel
  • 95,681
  • @Werner: Now you can edit my post ;-) – Marco Daniel Sep 08 '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 08 '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 08 '11 at 15:49
  • @aghsmith: I edited my post. Normally biblatex can simple replaced [What do to to switch to `biblatex](http://tex.stackexchange.com/questions/5091/what-to-do-to-switch-to-biblatex). – Marco Daniel Sep 08 '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 08 '11 at 16:40
  • @aghsmith: You can also load the package tocbibind: usepackage[notoc]{tocbibind}. Another solution you can find in my edited post (in few minutes) – Marco Daniel Sep 08 '11 at 16:43
  • A question about this code: Should the first of the two \hfill commands in each of the \@xhead re-definitions be eliminated? Separately, is it a good idea to set the page numbers in \slshape? – Mico Sep 08 '11 at 16:59
  • @Mico: The definition of \@ohead is taken from your questions. There the page numbers are also slanted. – Marco Daniel Sep 08 '11 at 17:06
  • @Marco: Just to clarify: I am not the OP of this question; I believe aghsmith is that person... All I did was to take your code and run it. That's when I noticed the bizarre look of the header lines caused by the surplus \hfill instruction. – Mico Sep 08 '11 at 17:22
  • @Mico: Oh Sorry. It was a mistake. – Marco Daniel Sep 08 '11 at 18:02
0

In case you want to remove the header entirely (e.g. because you do not use headers in the rest of the file), just add

\renewcommand\bibsection{}

to the preamble.

This should work in all templates working with natbib, such as iopart (IOP) for example.

dopexxx
  • 231
  • 2
  • 6