up JOS Home

For best viewing results

In order to see text that is matched in size to embedded math (which is handled using images), it is necessary to use fonts which are larger than the default font sizes in most Web browsers.

For example, I use the following settings:

These larger fonts will better match the enlarged math images (which are better anti-aliased). They are also easier to read if you are using a high-resolution monitor (mine is 105 dots per inch).

Why some math is misaligned vertically within text

It turns out Web browsers differ on the interpretation of "align=middle" within HTML text. As a result, formulas with "descenders" (anything below the text baseline) are incorrectly aligned vertically in some browsers such as Mozilla and Firefox. Here is an explanation as of 3/15/2005 by Ross Moore, principal maintainer of latex2html:

"LaTeX2HTML deliberately adds the 'padding' below images where there is a non-zero descender; i.e., where there is ink placed below the natural baseline of the mathematical expression. Enough padding is added to equalize the height and depth, so that there can be exact alignment at the middle of images placed next to each other.

Furthermore, the 'align=middle' used to mean that the images would align their middle with the baseline on the surrounding text. This worked perfectly with Netscape versions up to 4.xx .

[The HTML 4.01 spec states that ALIGN=MIDDLE in an IMG tag "means that the center of the object should be vertically aligned with the current baseline".]

It did not work so well with IE, since someone there decided that 'align=middle' means align with the middle of the text, rather than with its baseline.

While that may seem logical, in some sense, it is actually quite absurd --- as there is no consistent concept of what is the middle of a line of text. For example, the alignment changes with the font-size, whether there are uppercase letters, whether there are letters at a different size to others (e.g. via tags, perhaps even according to whether there are some letters with descenders (j,p,q,y) not to mention fancy fonts.

Indeed by just widening the window to allow more text onto a line containing an image (of inline-math, say) you could see the vertical positioning of the image change, as uppercase letters first move into that line.

Then with more recent versions of Netscape/Mozilla, they decided to interpret 'align=middle' in the same way as IE. Bug-reports were lodged, pointing out the error in this approach; and there has even been an acknowledgement that the new strategy is indeed a *bug*. But nothing seems to have changed in Mozilla or Firefox.

Some other browsers continue to 'do it right'. So you cannot rely on adopting image-making strategies specifically to make things look good in Mozilla or IE."
---

The Safari (MacOS X) browser evidently does the right thing, and Konqueror is said to be correct. Internet Explorer is said to have been fixed as of IE v6.01. (I have verified v6.02 myself, and it seems to be working fine.) Mozilla (including Firefox) continue to do it wrong, as of this writing. See Bugzilla Bug 192077 for further details.


up JOS Home