Generaladdress with "~"

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
nir_bz
Posts: 4
Joined: Wed Dec 05, 2007 10:22 am

address with "~"

Post by nir_bz »

Hi.

I wish to add an hyperlink to the following address : http://www.eng.tau.ac.il/~dan/

The LaTEX line I use for that is :
http://www.eng.tau.ac.il/$\sim$ dan/

However, when I click the link at the PDF document, it doesn't work ...
The "~" symbol ruins it ...

How can I overcome this problem ?!?

Thank you ...

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

address with "~"

Post by localghost »

As you may know from ASCII code, every character of a font has its number. In LaTeX you can get access to every symbol with a simple command.

Code: Select all

\symbol{num}
where num is a number from 0 to 127 (or 0 to 255, respectively). Now you can typeset the tilde by using this command.

Code: Select all

\symbol{126}
And finally you have the complete URL.

Code: Select all

http://www.eng.tau.ac.il/\symbol{126}dan/
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
nir_bz
Posts: 4
Joined: Wed Dec 05, 2007 10:22 am

Re: address with "~"

Post by nir_bz »

Thanks ...

The address in the PDF appears correct ... but when I click the link, it directs me to the following adress :
http://www.eng.tau.ac.il/%CB%9Cdan/

The problem is that the tilde is changed ...

How can I avoid this ?
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

address with "~"

Post by localghost »

The document symbols-a4 suggests a predefined body-text symbol which might help.

Code: Select all

\textaciitilde
The url package could also be helpful.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
nir_bz
Posts: 4
Joined: Wed Dec 05, 2007 10:22 am

Re: address with "~"

Post by nir_bz »

Thanks :-)

I used the URL package and it does the job ...
SmithWillSuffice
Posts: 15
Joined: Fri Feb 23, 2007 9:29 am

address with "~"

Post by SmithWillSuffice »

You can use tilde's in url's without loading the url package, just use hyperref, and follow the guidance here:

http://www.latex-community.org/forum/vi ... 63&p=47374

for getting tilde's to display in the typeset version of the url. The link itself should work fine if you use pdflatex and a sensible pdf reader.
Support Free Software---It's Made for Everyone
Post Reply