A patch to <IMG ALIGN=>

Michael C. Grant (mcgrant@gomez.stanford.edu)
Tue, 24 May 1994 18:49:20 -0700

Date: Tue, 24 May 1994 18:49:20 -0700
From: "Michael C. Grant" <mcgrant@gomez.stanford.edu>
Message-Id: <199405250149.SAA21042@gomez.stanford.edu>
To: mosaic-x@ncsa.uiuc.edu, www-html@www0.cern.ch, nikos@cbl.leeds.ac.uk
Subject: A patch to <IMG ALIGN=>

One of the problems with using in-line images to render equations is that
you can't easily align the baselines of the text with the baselines of the
equations. To see what I mean, look at


(I don't have transparent gif files yet so the equations have a white
background. This actually helps to illustrate the point better, though).
This is an "illegal" document of sorts, because it uses illegal values
for ALIGN which I talk about below. But, if your reader defaults to
ALIGN=BOTTOM in such cases you will get the desired effect.

For each of the in-text equations, you should notice that they are
shifted up by as much as 5 pixels depending on the length of the
descenders. (I also happen to think that the equations are rendered
poorly. I think that this can be improved considerably on the
LaTeX2HTML end, by using Metafont to generate lower-resolution
fonts, so I'm not so concerned about that yet).

If you read 


and especially the section called "Arbitrary baseline alignment"
for in-line images, you will see my proposed solution to this
problem. There is also a link there to a patch to a SINGLE FILE
in libhtmlw, HTMLformat.c, which adds this functionality. The link is


Try the patch out, and look at the example document above once
more. The improvement should be marked! If you want to see a nicer
looking document without the white backgrounds on the gifs, try


It is the same document, but it uses xbms which are much larger.

I think this is a rather simple enhancement to HTML, as the simplicity
of the patch demonstrates. I really think that in the long run it will
make a big difference for documents with equations, so I hope the
HTML+ discussion group will consider it.

Thanks for listening,
Michael C. Grant