I am trying to change the pagination on the first page of my references section. I've been using fancyhdr to customize the pagination in my headers per the requirements of the thesis format at my school. In the article class, the first page of a chapter gets its first page style reset to plain, so the fancyhdr style never applies since it goes overwritten. The fancyhdr manual offers a solution by saying to edit the plain style, but I need to keep the plain style because I am using that elsewhere. So my question is, how can I set the header/footer on the first page of my references section so that it uses the fancy style, without editing the plain pagestyle?
Here is a MWE:
\documentclass[12pt]{report}
\usepackage[natbibapa]{apacite}
\usepackage{lipsum}
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[R]{\thepage}
\pagestyle{fancy}
\begin{document}
\chapter{Test}
\thispagestyle{fancy} %% This works
\lipsum[1-4]
\citep{R, lme4, MCMCglmm, MASS, lmerTest, gplots, foreign, CAR, brms}
\bibliographystyle{apacite}
\thispagestyle{fancy} %% This doesn't work
\bibliography{References}
\thispagestyle{fancy} %% Nor this
\end{document}
With a References.bib file containing:
@Manual{R,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2015},
url = {https://www.R-project.org/},
}
@Article{lme4,
title = {Fitting Linear Mixed-Effects Models Using {lme4}},
author = {Douglas Bates and Martin M{\"a}chler and Ben Bolker and Steve Walker},
journal = {Journal of Statistical Software},
year = {2015},
volume = {67},
number = {1},
pages = {1--48},
doi = {10.18637/jss.v067.i01},
}
@Article{MCMCglmm,
title = {MCMC Methods for Multi-Response Generalized Linear Mixed Models: The {MCMCglmm} {R} Package},
author = {Jarrod D Hadfield},
journal = {Journal of Statistical Software},
year = {2010},
volume = {33},
number = {2},
pages = {1--22},
url = {http://www.jstatsoft.org/v33/i02/},
}
@Manual{lmerTest,
title = {lmerTest: Tests in Linear Mixed Effects Models},
author = {Alexandra Kuznetsova and Per {Bruun Brockhoff} and Rune {Haubo Bojesen Christensen}},
year = {2015},
note = {R package version 2.0-29},
url = {https://CRAN.R-project.org/package=lmerTest},
}
@Book{MASS,
title = {Modern Applied Statistics with S},
author = {W. N. Venables and B. D. Ripley},
publisher = {Springer},
edition = {Fourth},
address = {New York},
year = {2002},
note = {ISBN 0-387-95457-0},
url = {http://www.stats.ox.ac.uk/pub/MASS4},
}
@Manual{gplots,
title = {gplots: Various R Programming Tools for Plotting Data},
author = {Gregory R. Warnes and Ben Bolker and Lodewijk Bonebakker and Robert Gentleman and Wolfgang Huber Andy Liaw and Thomas Lumley and Martin Maechler and Arni Magnusson and Steffen Moeller and Marc Schwartz and Bill Venables},
year = {2015},
note = {R package version 2.17.0},
url = {https://CRAN.R-project.org/package=gplots},
}
@Manual{foreign,
title = {foreign: Read Data Stored by Minitab, S, SAS, SPSS, Stata, Systat, Weka,
dBase, ...},
author = {{R Core Team}},
year = {2015},
note = {R package version 0.8-66},
url = {https://CRAN.R-project.org/package=foreign},
}
@Book{CAR,
title = {An {R} Companion to Applied Regression},
edition = {Second},
author = {John Fox and Sanford Weisberg},
year = {2011},
publisher = {Sage},
address = {Thousand Oaks {CA}},
url = {http://socserv.socsci.mcmaster.ca/jfox/Books/Companion},
}
@Manual{brms,
title = {brms: Bayesian Regression Models using Stan},
author = {Paul-Christian Buerkner},
year = {2015},
note = {R package version 0.6.0},
url = {https://CRAN.R-project.org/package=brms},
}
I had to make the References section longer than a page in this MWE because otherwise, the single page is paginated correctly. But when longer than 2 pages, I can't seem to get the references section to use the fancy pagestyle on the first page.
Best Answer
If you don't want to redefine
plain
(even temporarily), you can redefinethebibliography
(from apacite.sty).Alternatively, you could just add
just before the bibliography.