[whatwg] Mathematics in HTML5

Michel Fortin michel.fortin at michelf.com
Sat Jun 10 07:55:27 PDT 2006

Le 10 juin 2006 à 5:01, White Lynx a écrit :

>>> I do not think that automatic mixing of roman and italic would be  
>>> a good
>>> idea at the browser side if one search a rapid cheap  
>>> implementation fully
>>> compatible with current standards.
>> That is probably quite right.
> Yes, roman as a default is Ok as a first approximation.
> Later extra line in author' s style sheet could provide TeX like  
> styling:
> 	formula, dformula {text-transform:math-italic;}

Hum, what do you expect "text-transform: math-italic" to do? If you  
want it to change every alphabetic character to the math italic  
equivalent, how do you avoid transforming "sin", "cos", "ln", "mod",  
to italic? You'll need at least one new element, maybe more, to  
distinguish these cases, and then you'll still need to use <var> to  
style non-scalar variables correctly.

This whole roman-letter-is-a-variable also makes the semantics quite  
strange: in the whole document you can find variables using the <var>  
element while inside formulas you must also look for roman characters  
inside text nodes but outside special "non-variable" elements. I  
don't think this concept fits HTML quite well.

I'm not advocating against math-italic, which can be useful to  
display variables correctly, just against implicit variable-making  
inside formulas. If math-italic is implemented, you'll still be able  
to use it like above, but I don't think that should be the  
recommended method of marking up formulas.

I think the idea of a script which would add variable markup  
automatically according to some rules is the best way to avoid extra  
manual markup without compromising presentation and/or semantics.  
This way different people will be able to create different tools  
adapted to their specific needs.

> Script that sniffs content of all text nodes tends to run slowly.  
> XSLT does this job faster (but does not work with HTML).
> In any case it would be nice to have simple solution like CSS "text- 
> transform".

Such a script could be implemented server-side, or be used by the  
author at the editor level, just like many HTML editors today have  
commands to make authoring easier.

> Script, fraktur and double-struck letters are available as separate  
> Unicode characters, so font-family may not be the best solution for  
> these scripts. In ISO 12083 they were available as a separate  
> character entities, not elements.

Adding character entities to HTML is really an option I believe. But  
small scripts (javascript or server-side) or an HTML editor could  
provide ways to insert relevant Unicode characters easily.

Michel Fortin
michel.fortin at michelf.com

More information about the whatwg mailing list