# How to add an email address with an underscore in the elsarticle.cls LaTeX template?

My LaTeX codes for the author and the corresponding address are:

\documentclass[preprint,12pt]{elsarticle}
\journal{elsarticle}
\begin{document}
\begin{frontmatter}
\title{Title}
\author{AuthorOne}
\author{AuthorTwo\corref{CorrespondingAuthor}}
\cortext[CorrespondingAuthor]{Corresponding author}
\end{frontmatter}
\end{document}


The output is as follow:

However, as the above clip shows, when my mouse is hovering over the second email, it does not show the entire email. Why?
Can anyone solve the problem?

You'd better not to change the based setting in the original elsarticle.cls LaTeX template.

• Could you please turn your code fragments into a compilable minimal working example (MWE) (tex.meta.stackexchange.com/q/228). With the information you currently give in your question, I am not able to reproduce your issue. Nov 18 '17 at 14:06
• The links are guessed by the PDF viewer; apparently its heuristics don't work in this case. If I try with Skim, the address is guessed right; with Acrobat Reader, no attempt at guessing a hyperlink is done. The elsarticle class never tries producing a hyperlink. Nov 18 '17 at 14:40

The elsarticle class does no attempt to make hyperlinks; what you see is an attempt of the PDF viewer to guess a hyperlink based on its internal heuristics.

You can get a real hyperlink with the hyperref package and a trick (because of how \ead works internally):

\documentclass[preprint,12pt]{elsarticle}
\usepackage{etoolbox}
\usepackage{hyperref}

\journal{elsarticle}

\newcommand{\definemail}[2]{\newrobustcmd#1{\href{mailto:#2}{#2}}}

\definemail\authorone{authorone@gmail.com}
\definemail\authortwo{authortwo\_2017@gmail.com}

\begin{document}

\begin{frontmatter}
\title{Title}
\author{AuthorOne}