I want to create a document with both header and footer. So far the footer has been working fine but not the header, which is missing for some reason. Do anyone have a clue as to why it happens?

%!TEX TS-program = xelatex
\documentclass[12pt]{article}

%opening
\title{Example}

\usepackage[margin = 1.0in]{geometry}
\usepackage{fancyhdr}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{braket}
\usepackage{fontspec}

\pagestyle{fancy}
\fancyhf{}
\rfoot{\thepage}
\setmainfont{Times New Roman}
\newcommand{\bd}{\textbf}

\begin{document}
\maketitle

\bibliographystyle{APA}
\bibliography{bibliography.bib}

\end{document}


• Actually the footer isn't working either, because the page number is in the centre, not right. The point is that when using \maketitle with the article class the page style plainis used. See e.g. tex.stackexchange.com/a/30230/82917 Mar 9 at 9:58
• Now that you mention it, I didn't recognize the footer was centered. I will check out the link you included. Thanks
– Rei
Mar 9 at 10:01
• @Rei -- welcome -- the answer below should work -- have alook -- I have not used bibliography so commented out Mar 9 at 10:18

\documentclass[12pt]{article}

%opening
\title{Example}

\usepackage[margin = 1.0in]{geometry}
\usepackage{fancyhdr}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{braket}
%\usepackage{fontspec}
\fancypagestyle{firststyle}
{
\fancyhf{}
\fancyfoot[R]{\footnotesize Page \thepage}

• Thank you. So I suppose the way to go here is to overwrite the plain style with your firststyle and apply it to the paper, is that right?
• first option have a look at the documentation -- second this site has numerous examples of fancyhdr -- you can search in the bar above -- in case of specific problem please revert -- incidentally you can name your style anything as example \fancypagestyle{mystyle} and then initialise or call that style after begin document Mar 9 at 12:45