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 stop every URL in my document from being clickable in the resulting PDF.

I am using the url package, and the documentation claims that it "does not make hyper-links." So, I don't know why links are becoming clickable!

I also have some specific requirements that are met by the url package and not by the hyperref package, so simply using the hyperref package is probably not an option for me.

I'm using TeXShop 3.11 with Pdftex. The minimal example below generates a document with a clickable link to www.google.com when viewed in Preview.app in OS X 10.9.4.

\documentclass[10pt,letterpaper]{article}

\usepackage[hyphens]{url}
\urlstyle{same}

\begin{document}

foo \url{www.google.com} bar

\end{document}
share|improve this question

2 Answers 2

up vote 7 down vote accepted

It's your PDF viewer's fault: Mac OS X Preview (at least v7.0) recognises URLs and makes them clickable, whether they be typeset with a special package (hyperref, url) or not.

To convince yourself, try compiling the following example and open the output in Preview; the URL will be clickable.

So there's really nothing you can do about it on the author's side.

enter image description here

\documentclass{article}
\begin{document}
http://www.google.com
\end{document}
share|improve this answer
1  
Thank you sir, I appreciate it! –  andrewinfosec Aug 8 at 23:01
    
This seems to happen with other readers as well (I tried it with Sumatra PDF) –  Scz Aug 9 at 7:00

This problem seems to come from the pdf reader that is used. Therefore my idea is to add something invisible that breaks up the url for the program but not for the person reading it. Something like \url{www.google}\rlap{~}{.com} does not work, though, because the space ~ is ignored.

An ugly workaround that works for me (with Sumatra PDF) is:

\url{www.google}\rlap{ \color{white}X}{.com}

with \usepackage{color} in the preamble. Make sure to include the space, as otherwise there will be a link to www.googleX.com.

However, this only works if your background is white. Another downside is that you will not be able to copy the original url from the document. Maybe you can play around and replace X with something invisible.

share|improve this answer
    
Thank you! Once I learnt from the first answer that the cause is the PDF reader itself, I accepted that it's probably not something that I can fix (at least not easily). The ideas you propose are interesting however, and I appreciate your efforts! –  andrewinfosec Aug 10 at 19:32
    
Thanks! The stackexchange.com way to show your appreciation would be an upvote ;-) –  Scz Aug 11 at 16:24
    
Done! (I'm still new....) :-) –  andrewinfosec Aug 12 at 16:33

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.