Page LayoutHeaders for the Bibliography

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
jakob
Posts: 4
Joined: Fri Dec 09, 2011 5:13 pm

Headers for the Bibliography

Post by jakob »

Hi,
i am new to Latex (and to this forum). I still hope that the post is adequate since i searched the web for the whole day and couldnt find a solution to my problem (as simple as it might be in the end).

i use miktex 2.9 and write on texniccenter.
for my thesis, i use the package natbib for the bibliography (with bibtex) and fancyhydr for headers and footers. my problem is that i cannot change the style of the headers for the bibliography. more concrete, its uppercase and i want lowercase (i know, sounds trivial. i do it with

Code: Select all

\markboth{chapter}{}
for the other chapters).

i already tried

Code: Select all

%\renewcommand\bibsection{\subsection{\refname}}
to get rid of the bibliography header completely but if i do that i get the header from the previous section (or it screws up things completely).

i tried to write a minimal example, however its probably not as minimalistic as it could be (i included so many references since the headers are only on the second page):

Code: Select all

\documentclass[a4paper, 12pt]{book}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} %utf8?? versus latin1 wie abgespeichert wird. oder so.
\usepackage[ngerman, english]{babel} % hyphenation also trennung
\usepackage{fancyhdr} % headings and footers. 
\usepackage[square]{natbib} %citations
\usepackage[pdftex,colorlinks,linkcolor=blue,citecolor=blue,backref]{hyperref} % cite hyperlinks w/o pdfx

\begin{document}

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}} %only chaptername, fancyhydr page 10. 1
\renewcommand{\chaptername}{} %no "chapter"
\renewcommand{\sectionmark}[1]{\markright{#1}{}} 
\fancyfoot{} %clear foot
\fancyfoot[LE,RO]{\thepage}
\fancypagestyle{plain}{ %
	\fancyhf{} %clear all header and footer fields on pagestyle plain for chapter titles
	\fancyfoot[LE,RO]{\thepage} %s
	\renewcommand{\headrulewidth}{0pt} %no ruler first chapter page 
	}

\pagestyle{fancy}
\tableofcontents \markboth{Contents}{} %fuer no uppercase
\chapter{iwantniceheaders}
text \citep{bannister_kouzarides_2011, avery_1944}
\cleardoublepage
more citations \citep{bernstein_2007, bernstein_2005, bonasio_2010, brink_1958, cairns_2009, carlson_2004, dekker_2008, feinberg_2004, fuks_buergers_2000, goldberg_2007, goll_bestor_2005, helge_witek_2008}


\renewcommand\bibname{References} %change bibliography into References
\renewcommand{\bibfont}{\small}
\bibliographystyle{plainnat}
\bibliography{lit}
\addcontentsline{toc}{chapter}{References}
\end{document}
i also attached the pdf file how it looks for me. the actual problem are the headers on the last page.

thanks for any help...
Attachments
example.pdf
(73.77 KiB) Downloaded 532 times
Last edited by jakob on Wed Dec 14, 2011 4:16 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Jojoba86
Posts: 6
Joined: Fri Dec 09, 2011 7:52 pm

Headers for the Bibliography

Post by Jojoba86 »

Hey Jakob,

First a disclaimer, I'm also new to LaTeX. However, I've been wrestling with the same problem today (!), so here is my extremely ugly way of doing it.

Code: Select all

\fancyhf{}
\fancyhead[CO]{\slshape \rightmark}
\fancyhead[CE]{\slshape \leftmark}
\fancyfoot[C]{\thepage}
\addtolength{\headheight}{0.5pt}

\include{Chapter1/chapter1}
\include{Chapter2/chapter2}
\include{Chapter3/chapter3}
\include{Chapter4/chapter4}
\include{Conclusions/conclusions}

\appendix
\include{AppendixA/appendixa}
\include{AppendixB/appendixb}
\cleardoublepage

%\backmatter % book mode only

\fancyhf{}
\fancyhead[C]{\textit{Nomenclature}}
\fancyfoot[C]{\thepage}
\addtolength{\headheight}{0.5pt}

\include{Nomenclature/nomenclature}
\printnomenclature  %% Print the nomenclature
\cleardoublepage

\fancyhf{}
\fancyhead[C]{\textit{Bibliography}}
\fancyfoot[C]{\thepage}
\addtolength{\headheight}{0.5pt}

\bibliographystyle{thesis-custom}
\bibliography{yourbibfilehere} % References file
I do the same thing with the stuff at the start, as I find the contents header otherwise also comes out as "CONTENTS". My thesis does not need to shout at me! I hope someone else can provide a more elegant answer.

Hope this helps and makes sense, I've shown you what I did which may be a little different to what you need. Good luck with your thesis! I stumbled across this post when searching and thought it was a case of this, before I saw the date!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Headers for the Bibliography

Post by Stefan Kottwitz »

Hi Jakob,

welcome to the board!

You could use \nouppercase in the headings commands, such as

Code: Select all

\fancyhf{}
\fancyhead[LE]{\nouppercase{\leftmark}}
\fancyhead[RO]{\nouppercase{\rightmark}}
Stefan
LaTeX.org admin
Jojoba86
Posts: 6
Joined: Fri Dec 09, 2011 7:52 pm

Re: Headers for the Bibliography

Post by Jojoba86 »

Hi Stefan,

That's a much more elegant solution than what I posted, thanks :D .

In what I posted I have a Nomenclature section just before the Bibliography, but if I don't change the header before in the way I posted it takes the name of the chapter and section before it.

Do you know how I can change it to display the same way as the contents does?

If not I can always leave my ugly bodge in!

Thanks,
Ian
jakob
Posts: 4
Joined: Fri Dec 09, 2011 5:13 pm

Headers for the Bibliography

Post by jakob »

Hi Stefan,

thanks for the warm welcome and thanks even more for the solution, works perfect for me.

Ian, here is what i did for the bib section, maybe it helps:

Code: Select all

\renewcommand\bibname{References} %change bibliography into References
\renewcommand{\bibfont}{\small}
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\fancyhead[LE]{\nouppercase{\textit{\leftmark}}}
\fancyhead[RO]{\nouppercase{\textit{\rightmark}}}
\bibliographystyle{plainnat}
\bibliography{your bib files}
\addcontentsline{toc}{chapter}{References}
Post Reply