|
Editing MathML on the Web with AmayaIrène Vatton and Vincent Quint
This paper presents an implementation of MathML 2.0 in the web editor/browser Amaya. It shows the advantages that MathML can bring to the scientific community when implemented in conjunction with other web technologies. Amaya is a full-featured web client developed by W3C for experimenting and validating web specifications at an early stage of their development. In addition to MathML, the current version supports XHTML 1.0, CSS2, and HTTP/1.1. The latter allows Amaya users to browse the web and to publish pages on remote servers. Authors can create new pages or update existing pages with Amaya, which acts simultaneously as a browser and as an editor. The math editing/browsing functionality was developed specifically for MathML and follows closely the basic principles of MathML. Mathematical expressions are primarily considered as hierarchical structures, and most editing commands are based on this structure. Manipulating complex trees could be an issue for users, but Amaya provides an adequate user interface and some clever functions that make it easy to use. Thus, authors do not need to provide every structural detail of a complex expression. Instead, a parser analyzes the strings they type, such as y = 2ax + b, and it separates out numbers, identifiers, and operators to produce the right MathML structure: y = 2a InvisibleTimes x + b. The editor knows the MathML DTD. It can then provide powerful functions, such as generating all the required components of a construct created by the user or building a menu that proposes only the relevant attributes for the selected element. It can also transform the structure of an expression, for instance, a msubsup into a munderover. Also knowing the mathematical presentation rules, it can format and display expressions according to their structural context. When manipulating the MathML structure, the user interacts with a formatted representation of mathematical expressions, not directly with a tree. However, in some circumstances, to finely tune the details of a mathematical expression, other representations may be useful. For that purpose, Amaya provides several views of an expression. In addition to the formatted view, it can display the DOM tree and the source XML code. It also allows the user to edit any view, and it reflects all changes in all views. This has proven to be a great help when editing complex expressions. Authors do not create mathematical expressions in isolation, but as part of documents that are usually interspersed with a number of expressions. Integration of text and mathematics is a key issue. Amaya tackles this problem by using namespaces. Documents are represented as XHTML 1.0 pages. Formally, they are XML documents and can take advantage of the XML mechanisms for mixing various XML vocabularies in a single structure. As well as mathematical expressions, the whole document is represented by a tree in Amaya. This allows formulas and text to be integrated seamlessly. Text elements and formulas are part of the same structure and are manipulated by the same functions. This leads to a homogeneous user interface: all editing commands apply in the same way to both text and mathematics. Tight integration brings more benefits. At no additional cost, other web technologies available in Amaya can be used for mathematics. That is the case for links, style, and metadata. Amaya implements simple links from XLink. The source and the target of such links may be any element in a document tree, a textual element, or any part of a mathematical expression as well. Hypertext no longer applies to text and images only, but also to math. CSS is supported in Amaya to allow web authors to define the style of documents independently of their contents. Even if CSS is often used only for styling text, most of its properties apply to MathML equally well, and having a single mechanism to change the color, the font, or the size of characters, wherever they are, makes the user interface more consistent. It also provides new possibilities, such as drawing a frame around an expression, with the CSS property border. Amaya also provides an annotation service based on RDF. Anyone, not necessarily the document owner, can associate notes with any web document. These notes are independent documents stored on annotation servers, and they are associated with the documents they comment on by RDF assertions and XPath expressions. As equations are part of the same tree as the rest of the document, notes may be associated with any subexpression within an equation. This functionality makes writing scientific documents with coauthors much easier. All of these features demonstrate that, when combined with other web technologies, MathML can really be considered as the vehicle of choice for sharing scientific information over the web. |