[pdftex] Tilde character in url.

Andres Lahe alahe at staff.ttu.ee
Fri Apr 9 21:29:35 CEST 2010


John Culleton wrote:
> On Friday 09 April 2010 14:08:02 Reinhard Kotucha wrote:
>   
>> On 9 April 2010 John Culleton wrote:
>>  > In plain pdftex I am typing the following url:
>>  > \url{http://www.tux.org/~milgram/bookland}
>>  > {http://www.tux.org/~milgram/bookland}
>>  >
>>  > The problem is the tilde character.  TeX persists in treating it
>>  > either as an unbreakable space or as an accent over the following
>>  > character.  The tag \tilde only works in math mode and again it
>>  > wants to be on top of the next character.
>>
>> The tilde is an active character.
>>
>> \bgroup\catcode`\~=12
>>   \url{http://www.tux.org/~milgram/bookland}
>>   {http://www.tux.org/~milgram/bookland}
>> \egroup
>>
>> You can also try \~{}.  The empty group prevents TeX from putting it
>> over the following character.
>>
>> Regards,
>>   Reinhard 
>>     
> First thanks to those who responded.  The problem is not just printing the 
> character but also passing it on to the local web browser. Your first 
> solution, with the \catcode change enclosed in \bgroup \egroup etc. is the 
> one that works. The second suggestion  with  \~{}
> prints OK but does not reproduce properly in the url. 
>
> I did not try Wouter's suggestions, since yours came first, and works :<)
>
> Now I have to republish the e-book wherever it exists :<(
>
>   
For pdflatex I use  \string~   
\hyperbaseurl{http://staff.ttu.ee/\string~alahe/konspekt/myCD/}
and it works: http://staff.ttu.ee/%7Ealahe/konspekt/myCD/opik_eme_html.pdf
Andres

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pdftex/attachments/20100409/b3daae15/attachment.html>


More information about the pdftex mailing list