[Tex/LaTex] Changing the Footer in an Overleaf template

header-footeroverleaftemplates

I am writing a Physics paper for the final project in one of my classes and I decided this would be a good opportunity to learn some of the basics of LaTeX. I made an Overleaf account and have been working with this template

https://www.overleaf.com/latex/templates/template-for-preparing-your-research-report-submission-to-pnas-using-overleaf/fzcbzjvpvnxn#.WD8wFVLPpdM

with success, but I am not sure how to delete or edit the section of the document that says "PNAS | November 30th 2016 | vol. XXX | no. XX | 1-3" or how to change the any of those values from the template. Is there a way to do this that I am unable to find? The source code is on the link I provided above. Any help appreciated.

Best Answer

The footers are set using fancyhdr (loaded on lineĀ 201 in pnas-new.cls). It creates a firststyle page style which sets the headers/footers of the first page:

\makeatletter
\fancypagestyle{firststyle}{
   \fancyfoot[R]{\footerfont PNAS\hspace{7pt}|\hspace{7pt}\textbf{\today}\hspace{7pt}|\hspace{7pt}vol. XXX\hspace{7pt}|\hspace{7pt}no. XX\hspace{7pt}|\hspace{7pt}\textbf{\thepage\textendash\pageref{LastPage}}}
   \fancyfoot[L]{\footerfont\@ifundefined{@doi}{}{\@doi}}
}
\makeatother

Then it further defines the default header/footer layout (which will be used for pages 2 and onward):

% Headers
\fancyhead[LE,RO]{}
\fancyhead[LO,RE]{}
% Footers
\lfoot{}%
\cfoot{}%
\rfoot{}%
\makeatletter
\fancyfoot[LE]{\footerfont\textbf{\thepage}\hspace{7pt}|\hspace{7pt}\@ifundefined{@doi}{}{\@doi}}
\fancyfoot[RO]{\footerfont PNAS\hspace{7pt}|\hspace{7pt}\textbf{\today}\hspace{7pt}|\hspace{7pt}vol. XXX\hspace{7pt}|\hspace{7pt}no. XX\hspace{7pt}|\hspace{7pt}\textbf{\thepage}}
\fancyfoot[RE,LO]{\footerfont\@ifundefined{@leadauthor}{}{\@leadauthor}\ifnum \value{authors} > 1\hspace{5pt}\textit{et al.}\fi}

If you want to change the footer on the Right side of Odd pages (which you mention in your question), remove \thispagestyle{firststyle} (lineĀ 51 in PNAS-template-main.tex) and add

\fancyfoot[RO]{}% Clear footer on Right Odd page

Alternatively, redefine the entire firststyle page in your preamble using the layout you want:

\fancypagestyle{firststyle}{
   \fancyfoot[R]{<your right footer>}
   \fancyfoot[L]{<your left footer>}
}
Related Question