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.


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


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
  • 1
    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

1 Answer 1


In your preamble write


and in your body, whenever you want to insert the Google hyperlink, call the macro

the answer to this can be easily found, for example, by searching 
on \kexxcreamGoogleUrl.
  • 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
    – kexxcream
    Jul 28, 2016 at 20:14
  • Did you load hyperref? (\usepackage{hyperref}) Jul 28, 2016 at 20:21
  • My apologies, I loaded it first but managed to rewind my edits with CMD+Z. Now everything works correctly. I greatly appreciate your time in helping me with this issue.
    – kexxcream
    Jul 28, 2016 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.