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.

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

2 Answers 2

For typing URLs, you should import the url package:

\usepackage{url}

and then use the \url macro:

\url{www.website.com/~aname}

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:

\~{}

http://en.wikibooks.org/wiki/LaTeX/Print_version

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