Page Layout\pagestyle not working for first page of bibliography

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
emonier
Posts: 4
Joined: Fri Jul 31, 2009 5:14 am

\pagestyle not working for first page of bibliography

Post by emonier »

Hi everyone,

I am trying what I believe is a simple thing: page numbering in roman in the center of the footer for the table of content, then in arabic in the right corner of the header for the rest of my dissertation. Everything works well using \pagestyle and the fancyhdr package except for the first page of the references which displays the page number in the center of the footer. The following pages of the references are fine with page numbers in the right corner. I just don't get it. Can anyone help me fix this silly issue?

Here is the code:

Code: Select all

Code, edit and compile here:
\documentclass[letterpaper, 12pt, oneside]{book}
\usepackage{fancyhdr}
\fancyhf{}
\fancyhead[R]{\thepage}
\fancyhfoffset[R]{0.5in}
\begin{document}
\pagenumbering{roman}
\pagestyle{plain}
\tableofcontents
\newpage
\pagenumbering{arabic}
\pagestyle{fancy}
\input{Plain-text.tex}
\newpage
\bibliographystyle{plain}
\bibliography{mybiblio}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

\pagestyle not working for first page of bibliography

Post by localghost »

Read Section 7 (Redefining plain style, p. 7f) of the fancyhdr manual. Concerning page numbering you can also take a look at the commands \frontmatter, \mainmatter, \backmatter which are provided by the book class.

Chapter pages are usually typeset in plain page style. This intentionally is done to make them contrast with the other pages. This way they are recognized better when browsing a printed document.


Best regards
Thorsten
emonier
Posts: 4
Joined: Fri Jul 31, 2009 5:14 am

\pagestyle not working for first page of bibliography

Post by emonier »

Thank you. I solved my problem. I didn't realize that some latex commands, like \thebibliography I guess, use the \thispagestyle command to automatically switch to the plain page style.

I redefined the plain style just before adding the biblio in order to get the page number in the right corner and it worked perfectly. Thanks.

Here is the modified code in case someone runs into the same problem.

Code: Select all

Code, edit and compile here:
\documentclass[letterpaper, 12pt, oneside]{book}
\usepackage{fancyhdr}
\begin{document}
\pagenumbering{roman}
\pagestyle{plain}
\tableofcontents
\newpage
\pagenumbering{arabic}
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyhead[R]{\thepage} % except the right top corner
\renewcommand{\headrulewidth}{0pt} % remove line between header and main text
}
\pagestyle{plain}
\input{Plain-text.tex}
\newpage
\bibliographystyle{plain}
\bibliography{mybiblio}
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Post Reply