next up previous
Next: 7. Cross References Up: A Short Beginner-User's Guide Previous: 5. Hypertext

Subsections

   
6. Introducing Images in documents


6.1 Basic problem

The basic problem with images in document is the following:

(i) LaTeX handles only PostScript files to make figures

(i) HTML is not able to handle PostScript images

For the moment the only solution to have a figure correctly handled in paper and electronic documents is to have both version of the figure's file: file.ps and file.gif . The .ps version will be used by LaTeX to produce in-lined figures, while the .gif version will be used by LaTeX2HTML to produce in-lined images (the way to convert a PostScript image into a gif file will be explained below).

Then we need to have separate commands for LaTeX and for LaTeX2HTML to display the two different files. This is basically done using the conditional environments, with the following syntax:


${\tt\backslash begin \left \{ latexonly \right \} }$
${\tt\backslash begin \left \{ figure \left[... \right]\right \} }$
${\tt\backslash includegraphics \left \{ ... \right \} }$
${\tt\backslash begin \left \{ figure \left[... \right]\right \} }$
${\tt\backslash begin \left \{ latexonly \right \} }$


${\tt\backslash begin \left \{ htmlonly \right \} }$
${\tt e.g.: \backslash htmladdimg \left \{ file.gif \right \} }$
${\tt\backslash begin \left \{ htmlonly \right \} }$



6.2 Various types of HTML images

To simplify, three types of images in HTML pages can be distinguished:

* inactive image:
images which are inactive
* active images:
images which are active
* active mapped images:
images which are active by part (each part of the image leading to a different link).



6.3 Including inactive images

The strict electronic-equivalent for figures in the paper document are inactive images.

Here is the syntax to insert a inactive image in the HTML version:

\htmladdimg{file.gif}

where gif.gif is a .gif image located in the HTML directory created under the .tex source file.


Note: The path for the LaTeX figure must start from the directory where the LaTeX source file file.tex is. On the other hand, the path for the HTML image must start from the directory created by LaTeX2HTML under the directory where the LaTeX source file is.


Here is the behaviour of the above example block when processed by the current software that have been used to produce the document you are reading:

fig_GR.gif



6.4 Including active images

Active images are NOT PROVIDED specifically by LaTeX2HTML package.

However, it is possible to include them in the electronic version of the document since it is always possible to include any HTML specific command in the source file by the \rawhtml environment:

\begin{rawhtml}
...
\end{rawhtml}

This is the command to obtain a clickable (.GIF) Image in the HTML version of the document:

<a href="target_URL"><img SRC="source_image.gif" LOWSRC="idem.gif" ALT="text" 
BORDER=0 height=297 width=488 align=TEXTTOP></a>

Note: There is no need to be a HTML syntax expert to find this syntax: The syntax can be retrieved through the page Composer associated to the Navigator, and then copy-pasted in the source file.


Here follows (only in HTML version) an image for which the target_URL is a PostScript file (activates GhostView or a download of the file, according to the action specified in the "preferences" menu of the navigator):

image ex


Here follows (only in HTML version) an image for which the target_URL is a internal link to another part of the text (namely the top level).

image ex



6.5 Including active mapped images

This is an advanced feature which is not in the scope of this documentation. Moreover, this kind of feature has no obvious link with the spirit of a technical or scientifical documentation, hence it will not be described here; the reader is referred to Nikos Drakos documentation.



   
6.6 File conversion from PostScript to "GIF"

An easy way to achieve the PostScript to GIF conversion is to use xv: Having the figure on the screen at the desired magnification (e.g. by GhostView), run xv, then use the "Grab" button to import the image into GhostView. Then you can clip the interesting part with the "Crop" button, and save to a GIF file with the "Save" button (don't forget to move the GIF file at the right place after).


next up previous
Next: 7. Cross References Up: A Short Beginner-User's Guide Previous: 5. Hypertext
Pierre BENARD
2002-06-19