TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

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

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.

...also see How does one insert a backslash or a tilde into LaTeX? – Werner Sep 13 '11 at 12:06

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.

share|improve this answer

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$.

share|improve this answer
It works, thanks! – Alfred Zhong Sep 13 '11 at 4:18