[whatwg] Mathematics in HTML5
Michel Fortin
michel.fortin at michelf.com
Wed Jun 7 16:50:17 PDT 2006
Le 7 juin 2006 à 14:47, Ian Hickson a écrit :
> So, while I applaud the re-use of ISO12083 here, it seems like an odd
> choice. The resulting language seems to be just as verbose as
> MathML, so
> why not just reuse MathML, which already has a Web presence? Also,
> your
> version of the vocabulary doesn't seem quite the same as ISO12083,
> which
> means we would be introducing yet another mathematical markup
> language, in
> a space which already has many such languages.
I'd like to try something a little simpler. So here is my idea for a
math markup.
I wrote that as a cheat sheet, not as a specification, because it was
simpler for me and because I think it gives a good glimpse at what
I'm trying to do. But surely a more formal specification with that
later on. Here it is:
- - -
Use <var> for variables of any kind, with a "type" attribute to
identify vector, matrix or other special kinds of variables.
<var type="vector">x</var>
Use <sup> for exponents.
<var>x</var><sup>2</sup>
Use <sub> for matrix indices.
<var type="matrix">X</var><sub>2,2</sub>
Use <frac> for fractions, with <num> and <den> inside, as proposed by
White and others.
<frac>
<num>1</num>
<den>2</den>
</frac>
Use <radical> for radicals, with <radix> and <radicand>, as proposed
by White.
<radical>
<radix>2</radix>
<radicand>2</radicand>
</radical>
Use <matrix type="..."> for matrices, with <mr> for rows, and <md>
for cells (like for tables). Just a one column- or a one row- matrix
for vectors.
<matrix type="det">
<mr><md>1</md><md>2</md></mr>
<mr><md>3</md><md>4</md></mr>
</matrix>
Use <fence type="..."> for any kind of fence.
<fence type="floor">expression</fence>
Use <bounds>, <sup>, and <sub> to add lower and upper bounds to
<fence type="bounds">:
<fence type="bounds">
<var>x</var>
<bounds>
<sub>0</sub>
<sup>100<sup>
</bounds>
</fence>
Use <integral> and <bounds> for integrals.
<integral>
<bounds>
<sub>0</sub>
<sup>100<sup>
</bounds>
3<var>x</var> d<var>x</var>
</integral>
Use <sum> and <bounds> for big sum operators.
<sum>
<bounds>
<sub><var>x</var> = 0</sub>
<sup>100<sup>
</bounds>
3<var>x</var>
</sum>
Use <product> and <bounds> for big product operators.
<product>
<bounds>
<sub><var>x</var> = 0</sub>
<sup>100<sup>
</bounds>
3<var>x</var>
</product>
Use <limit> for limits:
<limit>
<var>x</var> -> 0
</limit>
<frac>
<num><var>x</var></den>
<den>0</den>
</frac>
Use <formula> to delimit formulas that should stand out of the main
prose.
Use ruby annotations for the purpose of over- and under- script/braces.
<http://www.w3.org/TR/ruby/>
Assuming some generic element is adopted for localized numbers, it
could be reused inside formulas too.
- - -
Summary
16 new math-specific elements:
* <frac>, <num>, and <den>
* <radical>, <radix>, and <radicand>
* <matrix>, <mr>, and <md>
* <fence>
* <bounds>
* <integral>, <sum>, <product>
* <limit>
* <formula>
5 ruby annotation elements:
* <ruby>
* <rbc>, <rtc>
* <rb>, <rt>, <rp>
3 reused HTML elements:
* <var>
* <sup>, <sub>
I think all of these new elements can be styled decently with CSS. I
can't say much myself about how suitable it is for a conversion from
LaTeX however. I'd appreciate comments on that and any other issue or
omission.
Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/
More information about the whatwg
mailing list