[l2h] relative hyperlinks?

Ulrich Gruenebaum Ulrich Gruenebaum <grueneba@zkom.de>
Thu, 28 Mar 2002 12:31:00 +0100 (MET)

Hi again,

here is just another nice topic which I found
when preparing my single-file html document.
I created the html file with

  latex2html -split 0 -no_navigation xy.tex
and I found, that all generated URLs in hyperlinks in
"xy/xy.html" contain the _filename_ and are of the form


(i.e. "filename#anchor").

This may be partially necessary for multi-document html trees,
but makes it impossible to rename the single html file in
my case, as all contained hyperlinks will fail afterwards.

The solution would be another commandline option (ok, one more
doesn't really hurt ;-), which when enabled suppresses
the insertion of the filename into the URL, when the
filename is identical to the file in which the URL is used.

A problem with links containing the filename occures especially
in some mailreaders (e.g. a colleague of mine uses Netscape 4.61
on Win98), which try to display html attachments directly.
The mailreader handles the attached html file under a temporary
filename, so that the html file can be displayed, but the
hyperlinks are unusable for a reason, that is intransparent for
most users.

Removing "xy.html" from the hyperlinks, leaving them
in a relative form as HREF="#SECTION00030000000000000000"
(omitting the filename and leaving "#anchor" only)
solves the problem.

I don't know what the real and pure html standard says
about this relative form of a hyperlink, but according
to my experience links of this form work fine on
Netscape 4.x, Netscape 6, Opera 5 and InternetExplorer 5.
Ommiting the filname in hyperlinks is also demonstrated in
"HTML & XHTML" by Chuck Musciano & Bill Kennedy, 4th edition,
O'Reilly 2000, so I think ommiting the filename from the URL,
in cases where it is identical to the file in which the URL is
used is at least worth a commandline option ;-)

Best regards

 Ulrich Gruenebaum (grueneba@zkom.de)
 Tel. +49/(0)231/9700-337
 FAX  +49/(0)231/9700-474

 State Diagnostic Systems and Computer Networks
 Joseph-von-Fraunhofer-Str. 20
 D-44227 Dortmund (Germany)