LateXSL
limitations

An HTML-based approach can only approximate LaTeX output, for several reasons.

media

LaTeX and HTML are similar in that they provide markup that can be used for formatting, but the target media of the two languages are very different. LaTeX is a formatting language for paper publication, while HTML is meant for publication on the Web.

For example, many features of LaTeX have to do with paper and font size. But in a Web browser, size of the window is dynamically variable, and little can be assumed about fonts present on the user’s machine.

Also, LaTeX is primarily for display of mathematics, while HTML is meant for more general-purpose display of hyperlinked information.

There were some tags for mathematics formatting (frac and radic tags) defined in HTML 3.0, but these disappeared in 3.2

fonts

In making web pages, very little can be assumed about the nature of fonts on a reader’s system. In contrast, LaTeX actually specifies and includes families of font faces.

In the 1990s, several attempts to provide “dynamic fonts” or “web fonts” were made. The idea was to allow a web designer to provide font files that would be downloaded to the browser. But these efforts have been largely dropped, and only Microsoft’s browser still supports them.

However, the ascendancy of the Unicode standard, and the more general availability of Unicode fonts, has greatly alleviated the problem of the existence of a glyph for a certain character on the Web.

But other problems remain. Some characters are useful for math formatting only if the height and position of their glyphs is right. For example, the radical sign is useful mostly if it touches the top line of the font. And unless the summation, integral, etc symbols are quite right (they should go from the top lie of the font to the bottom), it will be hard to properly position limits relative to them.

Unfortunately, many popular fonts that do include glyphs for the characters have not been produced with math formatting in mind.

The impacts on display of LaTeX on the Web are:

CSS positioning

Formatting in HTML has been revolutionized by CSS, but this formatting language has its weaknesses, one of the worst being positioning. The standard is so poorly conceived and written, that many reasonable-looking positioning specifications will produce completely different results in every browser you try.

You can still position elements with respect to one another, but it requires a lot of fiddling and experimentation.

CSS also has no notion of creating an ensemble element whose size reflects the boundary of the ensemble. Always, the positioned items float over the other text unless special measures are taken.

transformations of characters

In LaTeX, certain characters, such as brackets, may be stretched horizontally or vertically to span multiple lines. The best approximation to this in HTML is to make the character much bigger, but the results are not pretty.

The LaTeX commands \overline and \underline can be approximated with HTML formatting (but there is a cost: this formatting is lost in text-only representations…)

Also, LaTeX provides \overbrace, which rotates a curly brace to be horizontal, and stretches it horizontally over a span of text. There is no nice way to do this in HTML. Such things can be done in SVG…but how to integrate that into an HTML document?