4

I am writing a document using the pre-packaged elsarticle template. I need to submit the paper so that there are page numbers on all pages, including the title page, in the upper right hand corner. I have managed to get the page numbers to the upper right hand corner, but I have scoured the forums and I cannot make a number appear on the first page. I think there is something basic I am likely missing, but any help would be appreciated.

Here is what my document looks like:

\documentclass[preprint,review,12pt]{elsarticle}

\usepackage{lineno,hyperref}
%\modulolinenumbers[5]

%%%% 
\usepackage{amssymb}
\usepackage{multirow} 

\begin{document}


%adds page numbers to the upper right
\pagestyle{myheadings}


\begin{frontmatter}


\title{Title}

 \author[rvt]{My Name}
 \ead{My Email}

 \cortext[cor1]{Corresponding author}

 \address[rvt]{My Address}


\begin{abstract}

Abstract goes here... 

\end{abstract}


\begin{keyword}
keyword 1 \sep keyword 2
\end{keyword}

\end{frontmatter}

Main text

\end{document}
1
  • Do you mean there's an Elsevier journal asking for something out of their own standard? Have you tried \thispagestyle{}?
    – Rafael
    Apr 29, 2016 at 19:46

1 Answer 1

6

Under the preprint option of elsarticle, the pprintTitle page style is invoked via

\thispagestyle{pprintTitle}

Let's see what this page style does:

\def\ps@pprintTitle{%
     \let\@oddhead\@empty
     \let\@evenhead\@empty
     \def\@oddfoot{\footnotesize\itshape
       Preprint submitted to \ifx\@journal\@empty Elsevier
       \else\@journal\fi\hfill\today}%
     \let\@evenfoot\@oddfoot}

Both odd and even headers are cleared (set to \@empty). Since the title appears on an odd page, we can update \@oddhead inside \ps@pprintTitle via an etoolbox patch:

enter image description here

\documentclass[preprint,review,12pt]{elsarticle}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\ps@pprintTitle}% <cmd>
  {\let\@oddhead\@empty}% <search>
  {\def\@oddhead{\mbox{}\hfill\thepage}}% <replace>
  {}{}% <success><failure>
\makeatother

\begin{document}

%adds page numbers to the upper right
\pagestyle{myheadings}

\begin{frontmatter}

  \title{Title}

  \author[rvt]{My Name}
  \ead{My Email}

  \cortext[cor1]{Corresponding author}

  \address[rvt]{My Address}

  \begin{abstract}
    Abstract goes here... 
  \end{abstract}

  \begin{keyword}
  keyword 1 \sep keyword 2
  \end{keyword}

\end{frontmatter}

Main text

\end{document}
2
  • 5
    If this is a template for submission, I'd advise against it. Clarify from the source publisher whether this is indeed a requirement.
    – Werner
    Apr 29, 2016 at 19:57
  • Thank you! That did the trick. I think that the discrepancy is that elsevier provides a basic template to be used for its journals, but the specific journal I am submitting to explicitly asks for page numbering to be done in this way.
    – Jim
    Apr 29, 2016 at 22:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .