[Tex/LaTex] How to add an email address with an underscore in the elsarticle.cls LaTeX template

authorelsarticleemail

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}
\ead{authorone@gmail.com}
\author{AuthorTwo\corref{CorrespondingAuthor}}
\ead{authortwo\_2017@gmail.com}
\cortext[CorrespondingAuthor]{Corresponding author}
\end{frontmatter}
\end{document}

The output is as follow:

enter image description here

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.

Best Answer

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}
\ead{\authorone}
\author{AuthorTwo\corref{CorrespondingAuthor}}
\ead{\authortwo}
\cortext[CorrespondingAuthor]{Corresponding author}
\end{frontmatter}
\end{document}

enter image description here

Related Question