Possible Duplicate:
URL with tilde character?

I tried \~, which doesn't work; the ~ will appear on top of the following letter. ~ will print nothing but an empty spot. What I want is to print a website link like www.website.com/~aname in my document using LaTeX.

How can I do it? Google didn't give me an answer.

marked as duplicate by Loop Space, Werner, Stefan Kottwitz Sep 13 '11 at 12:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

migrated from stackoverflow.com Sep 13 '11 at 10:16

This question came from our site for professional and enthusiast programmers.


For typing URLs, you should import the url package:


and then use the \url macro:


This will take care of all the details. Moreover, if you also use the hyperref package, you will get a nice clickable link in the resulting PDF.


Try this:



However this will place the ~ higher up (as though it were above a letter that isn't there). A more elegant solution would be: $\sim$.