next up previous
Next: HOW HTX LINKING WORKS
Up: ESTABLISHING CROSS-REFERENCES
Previous: Linking your Hypertext Documents

  Using Cross-References from LaTeX

It is quite straightforward to insert HTX cross-reference anchors in HTML form directly into documents when writing them by hand. However, many substantial documents already exist in LaTeX format and can be converted relatively easily into hypertext by using the LaTeX2HTML converter (see SUN/201). LaTeX is, in any case, a convenient format for the primary source of many documents.

A facility is therefore available for generating HTX cross-references from commands within LaTeX documents. The LaTeX commands involved are normally ignored, but are detected by the star2html command that provides Starlink additions to the standard LaTeX2HTML . To allow these commands to work, the appropriate document preamble must also be included. The procedure to follow is described in SUN/199, but an outline of the principles involved is also given here.

To export an HTX cross-reference label from a LaTeX document that is to be converted into hypertext, the following would be used:

\xlabel{label}

which results in the HTML anchor:

<A NAME=xref_label>?</A>

where "?" is some invisible character that simply serves to mark the position to which links should point. Note that the name of the label chosen should be unique within a LaTeX document and must only contain alphanumeric characters (or be blank).

To insert a cross-reference to the target above into another document, you would use:

\xref{any text}{docname}{label}

which results in the HTML anchor:

<A HREF="/star/docs/docname.htx/docname.html#xref_label">any text</A>

This contains an initial guess at the required URL, which will be recognised and modified as necessary when the document is linked.



next up previous
Next: HOW HTX LINKING WORKS
Up: ESTABLISHING CROSS-REFERENCES
Previous: Linking your Hypertext Documents



HTX Hypertext Cross-Reference Utilities
Starlink User Note 188
R.F. Warren-Smith
6th January 1998
E-mail:rfws@star.rl.ac.uk