W3C home > Mailing lists > Public > www-amaya@w3.org > January to March 2009

MathML: introduction of editing modes

From: Frédéric WANG <fred.wang@free.fr>
Date: Fri, 06 Mar 2009 19:42:50 +0100
Message-ID: <49B16EAA.8080403@free.fr>
To: www-amaya@w3.org
> 2. introduce modes -- set of additional rules. For example in "chemistry
>    mode" to all <mi> with content element=H,He,Li,...,Mt class="chem" 
> will be
>    added, so with switched chem mode it will take seconds to type 
> K[Fe(CN)6]2-
>    (here C and N should be automatically splited). In LaTeX for the same
>    purpose I use predefined command \chem. Another example "units 
> mode": class
>    "MathML-Unit <http://www.w3.org/TR/mathml-units/>" will be added. 
> In both
>    cases styles of identifier will be written in css.
Hi Vladislav,

  So finally I found time to study how to implement your proposal in 
Amaya. Today, I've committed an experimental parser for chemical 
formulae (currently disabled). I would like to know more precisely the 
syntax and semantic of the language. For the moment, the parser can only 
read a single chemical formula at a time. Is it what you expect or do 
you think the language should be extended to recognize chemical 
equations such that "8H3O+ + MnO4- + 5e- ->  Mn2+ + 4H2O"? Also, In the 
example you gave, you use both brackets and parenthesis. What is the 
semantic difference between the two symbols? Currently, the parser uses 
them to determine an order of priority and do not generate the 
corresponding <mo>'s in the MathML code. FYI, here is the grammar used:

list_of_formulae: list_of_formulae chemical_formula | chemical_formula
chemical_formula: chemical_formula2 | chemical_formula2 integer
chemical_formula2: atom | '(' list_of_formulae ')' | '[' 
list_of_formulae ']' | chemical_formula2 exponent
exponent: integer sign | sign


integer: [0-9]+
sign: -|+

Frédéric Wang
Received on Friday, 6 March 2009 18:46:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:53:40 UTC