W3C home > Mailing lists > Public > public-fx@w3.org > April to June 2012

Re: [Filter Effects][css3-transforms] Using MathML for formulas

From: Dirk Schulze <dschulze@adobe.com>
Date: Sun, 22 Apr 2012 06:07:42 -0700
To: Aryeh Gregor <ayg@aryeh.name>
CC: Rik Cabanier <cabanier@gmail.com>, "public-fx@w3.org" <public-fx@w3.org>
Message-ID: <EBB6E362-EE09-4937-8C03-53F3A8E79467@adobe.com>


On Apr 22, 2012, at 2:12 AM, "Aryeh Gregor" <ayg@aryeh.name> wrote:

> On Sat, Apr 21, 2012 at 9:48 AM, Dirk Schulze <dschulze@adobe.com> wrote:
>> Even if viewers are not consistent, at least specifications should be. Ideally we use MathML and provide some fallback. Sadly I have no idea how it can be done without JS (which is not necessarily enabled and shouldn't be required to read a specification).
> 
> I think you can do something sneaky using CSS selectors, like
> 
> @namespace mathml "http://www.w3.org/1998/Math/MathML";
> math { display: none }
> mathml|math { display: block }
> mathml|math + .fallback { display: none }
> 
> Then use markup like
> 
> <math><!-- MathML here --></math>
> <img class="fallback" ...>
That is a great idea! I'll experiment with it. Is there a special version of MathML we should require? MathML 1, 2 or 3? As far as I know Firefox and webkit try to support 3. But webkit is still a bit away from full support.

> 
> In a browser that puts <math> in the MathML namespace in text/html per
> HTML5, and supports CSS Namespaces, the <math> element will be visible
> and the <img> will vanish.  In browsers that don't support MathML or
> don't support CSS Namespaces, the <math> will vanish.  The only case
> in which it will fail unpleasantly is if the browser doesn't support
> CSS at all, in which case you'll get some mangled version of the
> <math> tag as well as the image.
> 
> You still have to contend with the possibility that browsers will have
> bad MathML implementations and would be better served by using the
> <img>, though.
Yes, that is the only thing I worry about. Most of our math is quite basic. Maybe it is not that a big deal.

> 
> On Sun, Apr 22, 2012 at 12:10 AM, Rik Cabanier <cabanier@gmail.com> wrote:
>> I really like the way wikipedia creates formulas:
>> http://en.wikipedia.org/wiki/Help:Displaying_a_formula. It's simple and the
>> output looks very good.
>> Maybe we can have texcv (http://en.wikipedia.org/wiki/Wikipedia:Texvc) on
>> the server when we send the HTML to the w3c server for post-processing.
> 
> texvc is basically just a thin wrapper around LaTeX, whose primary
> purpose in life is to sanitize input so users can't throw Wikimedia
> servers into infinite loops by defining recursive macros or whatever.
> It's also written in OCaml, and nobody understands it.  You're
> probably better off just shelling out to latex directly.

What ever we want to do, some kind of automatism would be great.

Greetings,
Dirk
Received on Sunday, 22 April 2012 13:08:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 22 April 2012 13:08:12 GMT