[whatwg] Mathematics in HTML5

Le 17 juin 2006 ? 7:01, White Lynx a ?crit :

> Yes, sup/sub will work like in HTML. This behavior is not perfect  
> in case
> of resizable operators, fences, matrices and vectors however in  
> this cases operator limits (llim/ulim) and fence markers (marker/ 
> submark) provide necessary functionality.

That's what I thought. I'm not sure I like the idea of expressing  
exponents using either <sup> or <ulim> depending on what's preceding  
it. So I thought I could suggest something else.

The goal of <fence> is to have resizable fence delimiters around an  
expression. What makes <fence> so difficult to implement (hence the  
abstract <fenced> element) is that it must support any arbitrary  
height. But even with the help of <fenced> a big problem remains:  
with current CSS capabilities, it is difficult to display arbitrary  
sized parenthesis or braces, or anything requiring more than what can  
be implemented using CSS borders.

I think all of this can be solved with one tiny change of paradigm.  
Instead of having <fence> decide itself of its size (which doesn't  
work with all kind of delimiters anyway), we could let the author  
decide of the delemiter's size around <fence>. If we had a size  
attribute, or something like that, with a list of predefined sizes  
for for <fence>, authors could choose the appropriate size according  
to the content. Different CSS rules could decide what to do for each  

     <fence size="medium">...</fence>

     fence[size="medium"]::before {
         content: url(open-medium-parenthesis.png);
     fence[size="medium"]::after {
         content: url(close-medium-parenthesis.png);

And, to return to my first point, elements following <fence> (like  
<sup>) could be aligned according to the fence's size:

     <fence size="medium">...</fence><sup>2</sup>

     fence[size="medium"] + sup {
         vertical-align: 5em;

Fence markers could be implemented in a similar way, and then you  
would no longer need a <fenced> element.

All this remains to be tested. I'm not sure it will work that well  
with text zoom for instance. But it could simplify the markup as well  
as it would solve the resizable delimiters problem. I know it's not  
ideal, but it could be a workable solution for current browsers. The  
manual sizing restriction could be waived one day if CSS capabilities  

It doesn't solve the thing for matrix though.

Michel Fortin
michel.fortin at michelf.com

Received on Saturday, 17 June 2006 05:41:54 UTC