Document ClassesBibliography with footer using fancyhdr

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
trollhunter
Posts: 2
Joined: Tue Dec 09, 2008 9:12 pm

Bibliography with footer using fancyhdr

Post by trollhunter »

Hello,

I have a rather stupid problem with the bibliography of a document where I want a footer created using fancyhdr to be displayed.
The problem is that, the footer does not appear on the bibliography page and the page number is displayed.
I tried to change the bibliography style from plain to fancy using \bibliographystyle{fancy} but it does not work.
Googling and reading the fancyhdr doc did not solve the problem.
The footer displays fine in the cover page which is created manually without using \maketitle as well as in the rest of the document.
Rationale for manually creating this page is that the end readers are more used to MS Word output than the LaTeX one ;)
I also payed attention to place \usepackage{fancyhdr} after the \usepackage{geometry} one.
Commenting out the nocite makes no difference.
The TeX distribution I am using is macTex with the TexShop environment.
Please find attached a sanitized version of the document's root file.

Thanks in advance,
Lionel
Attachments
help.tex
(717 Bytes) Downloaded 475 times

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Bibliography with footer using fancyhdr

Post by localghost »

Take a look at Section 7 (Redefining plain style, p. 7f) of the fancyhdr manual. Searching the forum will yield some good examples, too.


Best regards and welcome to the board
Thorsten¹
trollhunter
Posts: 2
Joined: Tue Dec 09, 2008 9:12 pm

Re: Bibliography with footer using fancyhdr

Post by trollhunter »

Hello Thorsten,

Mea Culpa, Maxima Culpa, I should have RTFMed the document deeper
Thanks a lot, looks like I needed some more sleep :)
Now it works just fine ;)

Kind regards,
Lionel
tempUser
Posts: 1
Joined: Wed Jul 29, 2015 5:03 am

Bibliography with footer using fancyhdr

Post by tempUser »

Below is a solution for your problem:

Code: Select all

\documentclass{article}[11pt]

% Set up header/footer:
\usepackage{fancyhdr}

\fancyhead{} % This clears whatever was there before
\renewcommand{\headrulewidth}{1pt} % Set to 0 if you don't want a bar at the bottom.
\fancyhead[RE, RO]{Your Name} % Right even, right odd pages.
\fancyhead[LE, LO]{Paper Type} % Right even, right odd pages.

\fancyfoot{}
\renewcommand{\footrulewidth}{1pt} % Set to 0 if you don't want a bar at the bottom.
\fancyfoot[RE, RO]{\thepage}
\pagestyle{fancy}

% Select page numbering type and location
\pagenumbering{arabic}
\rfoot{\begin{center}\thepage\end{center}}

%%%%%%%%%%%%

\title{Test Doc}

\begin{document}
\maketitle
\thispagestyle{empty}

\newpage
\section{Sample Section}
Words\dots


% This is the solution: First make the pagestyle plain. 
% Then after the bibliography, make the pagestyle fancy.
\pagestyle{plain}

\bibliographystyle{plain}
\nocite{*}				% list all refs in database, cited or not
\bibliography{refs}		% Bib database in refs.bib

\pagestyle{fancy}

\end{document}
The refs.bib file is the following:

Code: Select all

@misc{sample,
author = {SomeAuthor},
booktitle = {SamplePublication},
month = jan,
publisher = {ThePublisher},
title = {{Sample\_Reference}},
url = {ww.example.com},
year = {2015}
}
Post Reply