Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to insert a single URL that is clickable in the resulting PDF file I produce, but when I use the hyperref package, that turns every use of \ref, the table of contents, etc. into a hyperlink in the document. I just want the one URL to be a hyperlink. Any simple solutions?

share|improve this question
add comment

2 Answers

hyperref provides a hyper-link-less referencing through \ref* rather than \ref. On a case-by-case basis you can use use this. Or, a global alternative could be

enter image description here

\documentclass{article}
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\AtBeginDocument{%
  \let\oldref\ref% 
  \def\ref{\oldref*}}
\begin{document}
\section{A section}\label{one} This is section~\ref{one}. \url{http://tex.stackexchange.com}
\section{Another section}\label{two} This is section~\ref{two}.
\end{document}

The redefinition of \ref to \ref* is delayed until \AtBeginDocument.

share|improve this answer
add comment

Does this help?

\documentclass{article}
\usepackage{url}
  \let\oldurl\url
\usepackage{hyperref}
  \let\linkurl\url
  \let\url\oldurl
\begin{document}
  \url{http://google.com}
  \linkurl{http://goo.gl}
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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