# How to repeat a URL using the hyperref package

Problem:

I have a URL that I need to repeat multiple times over several chapters in a document but after looking and trying to use the hyperref package I was not successful.

Code:

I included the package using \usepackage{hyperref}, then I added the URL using the following:

\href{http://www.google.com}{Google}


Whenever I try to call it using \ref{} the URL will not be printed.

Desired outcome:

Label a URL and reference to it multiple times throughout a document.

• That is not what label and ref, and for that matter, hyperref is meant for. Jul 28, 2016 at 20:05
• But if it is an academic publication, it may be worthwhile putting the url in either the citation or the end notes and refer to it using the usual citation mechanisms. Jul 28, 2016 at 20:09

\newcommand\kexxcreamGoogleUrl{\href{http://www.google.com}{Google}}

the answer to this can be easily found, for example, by searching

• Thank you for the suggestion. I received the following error message when I tried this: Undefined control sequence. \kexxcreamGoogleUrl -> \href {http://www.google.com}{Google} l.741 \kexxcreamGoogleUrl Jul 28, 2016 at 20:14
• Did you load hyperref? (\usepackage{hyperref}) Jul 28, 2016 at 20:21