Background:
So basically, I would like to have a hyperlink to an email address. That email address, however, should not be fixed at the moment. It should be changeable.
So I tried to achieve that by defining the email as a new command, and then use it inside hyperref command.
But it doesn't seem to work. Latex gave me an error: undefined control sequence.
\documentclass{article}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=red}
\newcommand{\emailaddress}{jxhyctc@163.com}
\begin{document}
\href{mailto:\emailaddress}{\emailadrress}
\end{document}
Any help is greatly appreciated.