next up previous contents index
Next: Other style files Up: Special Features Previous: Image sharing and recycling

Active Image Maps

  

Image maps are images with active regions in which a Web surfer can click to send him off to another sector of cyberspace. LaTeX2HTML can design either inline ``figures'' or external ones (with or without a thumbnail version) to be image maps. However, HTML requires a URL of a HTML map file which defines the coordinates of each active region in the map with a destination URL. Usually, this map file is kept on the server machine, however HTML version 3 also allows it to reside on the client side for faster response. Both configurations are supported by LaTeX2HTML through the htmlimage options map and usemap , respectively.

Keeping such a map file up to date manually can be tedious, especially with dynamic documents under revision. An experimental program makemap   can help automate this process. This program (which is really a perl script) takes one mandatory argument and one optional argument. The mandatory argument is the name of a user map file, defined below. The optional argument is the name of the directory where the HTML map file(s) are to be placed.

The best way of describing how this works is by example. Suppose that a document has two figures designated to become active image maps. The first figure included a statement like,

\begin{figure}
\htmlimage{map=/cgi-bin/imagemap/BlockDiagram.map,...}
. . .
\end{figure}

The second figure had a line like,

\begin{figure}
\htmlimage{map=/cgi-bin/imagemap/FlowChart.map,...}
. . .
\end{figure}

A typical user map file, named report.map, might contain the following informationgif:

#
#  Define the location(s) of the labels.pl file(s):
#
+report/  URL
#
#  Define map #1:
#
BlockDiagram.map:       
label1  rect    288,145 397,189
label2  rect	307,225 377,252
label2  default
#
#  Define map #2
#
FlowChart.map:
label3  circle  150,100 200,100
label4  default

In this file, comments are denoted by a # sign in column 1. The line beginning with +bench states that the symbolic labels are to be found in the labels.pl contained in the directory report, and that its associated URL is as stated. Any number of external labels.pl files may be so specified. The block diagram image has two active regions. The first is a rectangle bounded by corners (288,145) and (397,189), while the second is a rectangle bounded by corners (307,225) and (377,252). These coordinates can be obtained with the aid of a program such as xv. If the user clicks in the first rectangle, it will cause a branch to the URL associated with symbolic label label1 defined in the labels.pl file found in directory report. The single active region in the flow chart figure is a circle centered at (150,100) and passing through point (200,100). Clicking in this region will cause a branch to symbolic label label3. Labels label2 and label4 will be visited if the user clicks anywhere outside of the explicit regions. If any labels are not defined in any of the labesl.pl files mentioned, they will be interpreted as URLs without translation.

The HTML image maps are generated and placed in directory report by invoking the command

makemap report.map report


next up previous contents index
Next: Other style files Up: Special Features Previous: Image sharing and recycling

Bo Milvang-Jensen
Tue May 28 19:03:54 MET DST 1996