[l2h] hyperref with tilde

Ross Moore ross at ics.mq.edu.au
Sun Nov 29 06:27:35 CET 2009

Hi Bob,

On 29/11/2009, at 11:04 AM, Bob van der Poel wrote:

> Hate replying to my own mail ... but I've sort of figured it out.

>
> With the following document:
>
> documentclass{book}
> \usepackage{html}
> \begin{document}
> \label{dog}
> The quick brown dog is referenced
> \hyperref[page]{here}{on page~}{}{dog}.
> \end{document}
>
> the commands:
>
>    latex test;dvips test
>
> works just fine.

As it should.
I spent a lot of time getting the \hyperref  command
to work in  html.sty .
It has various compatibility modes so that you can use it
consistently both with  LaTeX2HTML and with the  hyperref.sty
package under ordinary LaTeX processing.

> BUT, using
>
>   texi2pdf test
>
> shows the "~".

Hmm. But  texi  here means  'texinfo'  doesn't it?
Add this is designed for interpreting Unix 'info' coding.
Sorry I don't know the details for this, but is ~ meant to
be a non-breaking space under these circumstances?

If so, then there is clearly a problem with the definition
of the \hyperref  command with this.
It surely relates to the desire to have ~ as a bare character
when used within a URL, but to allow it to have its ordinary
(TeX) meaning when part of the anchor text.
This requires delicate \catcode switching.
Easy to get it wrong.

> I had the texi2pdf in my make files. Sort of like using
> texi2pdf since it takes care of label regeneration, but I'll change
> back to latex as the command. Unless someone else has a suggestion?

Hope this helps,

Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------