Skip navigation.

CSS Warrior

Posts tagged with "css"

Mathematical formulae in new dimension

, ,

One should be crazy to expect mobile browsers to be able to render mathematical formulae, especially when most of desktop browsers fail miserably on any kind of mathematical markup. But is seems that things look completely differently when you look at them from a higher dimension.

Upcoming new version of Opera Mini turned out to be capable of handling complex inline layouts, including CSS formatted math formulae. It managed to handle quite sophisticated stress tests much better then some of its desktop friends do.

MathML story continues

, , ,

Recently I joined W3C Math working group, where I will represent Opera Software. I am not the biggest supporter of MathML and often am considered among its oponents, however there are a lot of thing that can be done on MathML side and solving the existing problems requires some kind of coordination between Math WG, CSS folks and browser developers.

The intention is to address MathML/CSS compatibility issues that would make integration of MathML with the rest of technologies supported by browsers much easier. Today it is hard to judge what the actual outcome will be, but in overall I am optimistic as it seems that essential part of MathML can be reformulated in more CSS friendly manner and with a few CSS3 extensions one may merge it in XML + CSS framework.

Once the technical issues will be resolved and realistic spec will be available I think browsers will be able to reconsider their position on MathML support. Not sure whether this will finally bring more MathML content to web as being quite verbose MathML distracts essential part of potential users especially those from LaTeX community, but in the same time MathML3 may have both XML and non-XML input syntax like RELAX NG and XQuery have, so if successful this step may provide some kind of bridge between LaTeX and XML communities.



New Markup for Mathematical Articles

, , , ...

Work on new version of XML MAIDEN markup language that was started in august is finally done and XML MAIDEN 2.0 DTD was submitted to OASIS schema registry. Markup can be used to capture general structure of scientific articles (front matter, headers, sections, statements, paragraphs, references etc) and to outline basic structure of mathematical expressions in the way suitable for rendering with CSS.

Mathematical part of XML MAIDEN 2.0 DTD was carefully revised in order to remove existing nesting limitations and create markup that can handle arbitrary complex formulae obtained by combining common mathematical expressions such as indices (arbitrary complex subscripts, superscripts, prescripts, under and over scripts), fractions (including arbitrary deeply nesting ones), operators (with arbitrary complex, multiple under and over scripts), fences, radicals, matrices (including deeply nested ones, with markers), determinants, vectors and etc.

Scope and capabilities of mathematical DTD are roughly aligned with those of Electronic Manuscript Standard. DTD admits universal CSS2.1 style sheet that can imitate native support without imposing limitations on complexity of mathematical expressions. Certain restricted subset of XML MAIDEN DTD is interoperable and suitable for rendering in current browsers including Opera 7/8/9 , Mozilla 1.x, Safari 1.x and MSIE 5.5/6.0. Full DTD however requires stronger CSS2.1 support (flawless support for inline-blocks and inline-tables is crucial for proper functionality of default style sheet).



Future of CSS3 Math Module is unclear

The purpose of CSS3 math module was to add "properties targeted at styling mathematical formulas, building on on the layout model of the 'presentational' elements of MathML". Unfortunately future of this module is quite vague, no working draft was published so far and from private discussion with one of the key members of WG we learned that working group encountered serious problems in their attempt to integrate MathML into CSS visual formatting model, so work on math module may be abandoned. From one hand CSS WG is not ready to make drastical changes in CSS and from another hand without such a changes it is nearly impossible to merge MathML into XML + CSS formatting scheme. Possible solution of the problem is to reform MathML itself and make it more CSS friendly (it is quite realistic proposal) however Math WG does not seem to plan such a reform, as a result MathML and CSS are unlikely to be integrated.

Hopefully lack of CSS3 math module will not harm XML MAIDEN project that aims create alternative mathematical markup, fully integrated with CSS. At the moment XML MAIDEN is practically completely merged into CSS2.1 formatting model so problems with CSS3 math module will not undermine project, in particular taking into account that general CSS3 modules like advanced layouts, generated content, line, box model etc will drastically increase both markup processing and formatting capabilities of CSS.

Towards universal math style sheet

, ,

In spite of the fact that world wide web emerged in one of the center of European science — CERN, web standards failed to address needs of scientific community and most of current scientific articles (especially in technical areas like mathematics, physics and chemistry) are distributed in PDF format instead of more accessible and web friendly XML based solutions. One of the reasons for current situation is inability of browsers to render mathematical expressions. One way to address problem is to implement presentational MathML in all browsers.

Another one that was frequently discussed on Opera forums it to find CSS based solution.
The idea behind universal math style sheet was to write single CSS2.1 style sheets that would handle arbitrary complex math formulae obtained by combining and nesting subscripts, uperscripts, prescripts, under and over scripts, fractions, operators, matrices, vectors, determinants, cases, accents, fences, radical and other mathematical expressions. In this case any good CSS rendering engine would be able to render mathematical expressions without having native LaTeX/MathML/EMS support. The good news is that such a style sheet exists :idea: (that was not obvious from the first glance) and even works in one CSS rendering engine Prince 5 :smile: (CSS formatter developed by YesLogic). The bad news however that browsers does not have sufficient CSS2.1 support yet to process style sheet properly :cry:
Style sheet affords torture tests that are analog of MathML torture tests and contain some complex math expressions. Opera can't get them right, but
after fixing some CSS related bugs it should be able to render these and other much more complex formulae. Below are screen shots that show how Prince CSS formatter handles tests:

Formulae 1-7
Formulae 6-11
Formulae 12-19
Formulae 15-22
Formulae 23-28