[Tex/LaTex] How to print ‘~’ character using latex


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.

Best Answer

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.

Related Question