Sign up ×
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.

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 in my document using LaTeX.

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

share|improve this question

migrated from 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

2 Answers 2

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