[Tex/LaTex] elsarticle class not displaying email addresses

elsarticletitles

I am trying to format an article using the elsarticle class. I have followed the documentation included with the class file, but for some unknown (and incredibly irritating) reason the email addresses are not displayed in the frontmatter.

Here is a minimal example:

\documentclass{elsarticle}

\title{Remarks on something interesting}

\author[myu]{Author 1}
\ead{a1@myuniversity.edu}

\author[myu]{Author 2 \corref{cor1}}
\ead{a2@myuniversity.edu}

\address[myu]{My Department, My Building, My University in My City}

\cortext[cor1]{Corresponding author}

\begin{document}

\maketitle

\end{document}

Any idea how to make the email addresses display?

Best Answer

Although I agree that it is not clear from the documentation or the 8th entry in the FAQ pointed out by Werner, all the templates use \title, \author, \ead etc after \begin{document} and \begin{frontmatter}.

The reason it does not work before \begin{document} is that (for some reason), it writes the email addresses to the aux file (which means it needs two runs), and the aux file doesn't get read and re-opened for writing until \begin{document} (so in fact you see lines like \emailauthor{a1@myuniversity.edu}{Author 1} appearing on the terminal instead of getting written to the aux file).

Note that the frontmatter environment does nothing except \maketitle at the end (and some grouping), so I guess the supported syntax is to replace your \maketitle with the frontmatter environment. I have also done this in the following modification of your example.

I have also deleted the unwanted space between the author name and \corref.

Remember that you need to compile twice to see the e-mail addresses.

\documentclass{elsarticle}
\begin{document}

\begin{frontmatter}
\title{Remarks on something interesting}

\author[myu]{Author 1}
\ead{a1@myuniversity.edu}

\author[myu]{Author 2\corref{cor1}}
\ead{a2@myuniversity.edu}

\address[myu]{My Department, My Building, My University in My City}

\cortext[cor1]{Corresponding author}

\end{frontmatter}

\end{document}

Image of footer displaying the e-mail addresses (inspired by Gonzalo Medina's previous answer):

Image of footer

Related Question