# Links don't compile properly on pdflatex

For some reason, I can't get a link to generate when I use the \hyperref package with pdfLaTeX compiler. \hyperref[this is link text]{www.google.com} yields only a plain unformatted "www.google.com" in the finished document.

I'm running manually installed Texlive 2013 on Linux Mint 16 Cinnamon 32-bit. On a 64-bit Lenovo Thinkpad e420 machine.

Below is a shortened example of the doc I'm trying to compile:

\documentclass[letter]{article}
\usepackage{hyperref}

\begin{document}

\end{document}


Output for the above compiles to "Here's a hyperref. http://www.google.com" (no hyperlink or link text).

-
Welcome to TeX.SE! –  Mico Jan 28 '14 at 20:42

The syntax of \hyperref with the optional argument is:

\hyperref[<label name>]{<text>}


I assume, you do not have \label{This is a link to Google}. Then the text "http://www.google.com" appears without link to a non-existing label.

I think you want somethink like:

\href{https://www.google.com/}{This is a link to Google.}


Then the text "This is a link to Google." is a link to the URL https://www.google.com/.

-
That was dumb of me. I read the documentation too quickly and replaced \href with \hyperref. I was confounded by the fact that hyperref is defined, so I didn't get any errors; else I probably would have figured it out sooner.... argh. The simplest things. Thanks again! :-) –  Kevin Jan 28 '14 at 21:24

From the hyperref documentation (section 4 Additional user macros):

If you need to make references to URLs, or write explicit links, the following low-level user macros are provided:

\href[options]{URL}{text}


The text is made a hyperlink to the URL; this must be a full URL (relative to the base URL, if that is defined). The special characters # and ~ do not need to be escaped in any way.

So you're after \href{http://www.google.com}{This is a link to Google}.

-