Drag and Drop of formulae
From ActiveMathWiki
| Table of contents |
Goal
We wish to let recipients of a mathematical document transfer formulae presented there to a place they can input formulae such as:
- an exercise input
- a mathematical system such as the classical CASs
- an editing environment or even a TeX source
We wish such a transfer to happen in extensible fashion: there should be the possibility for a document producer to declare new symbols and for consumers to support it.
Our strict focus, thus far, is within the ActiveMath (http://www.activemath.org/) learning environment with input to the search and exercise formulae editors.
Why not copy-and-paste ?
Such transfer was originally expected to be copy-and-paste, being a more commonly used paradigm. However copy-and-paste needs long-term storage in all representation-formats which we do not see suitable and prefer the immediate negotiation brought by drag-and-drop.
Content negotiation
For ActiveMath user-initiated-transfer to happen a translation may be needed. ActiveMath uses OpenMath (http://www.openmath.org/) for formulae within OMDoc (http://www.mathweb.org/omdoc) documents; the set of symbols used in these OpenMath expressions is extensible.
Target encoding is maybe OpenMath, maybe Content MathML (http://w3.org/Math/), each with an indication of the set of supported symbols. Target encoding might turn out to be a presentation format (e.g. HTML, TeX, XHTML+MathML...).
Translation
In the ActiveMath usage, translation from OpenMath to the presentation formats is, mostly, a story of the presentation process... used as a combination of XSLTs and Velocity, partially generated by the notations elements (which associate OpenMath to MathML fragments ) nothing new here. (more references available if you wish)
Translation from an OpenMath (or Content-MathML) using fancy symbols to standardized sets of symbols such as the MathML CD-group (http://www.openmath.org/cocoon/openmath/cdfiles2/cdgroups/mathml.cdg) covering the symbols found in the Content MathML specification requires a different translation process and may, sometimes, fail.
We propose this translation to be provided by authors who define new symbols. Such translations are made by pairs of OpenMath objects and provide translation from one CD-group to another.
Transfer from a Web-Browser
ActiveMath is happening on the web and uses web-browsers.
There is a drag-and-drop API only in MSIE (see here (http://msdn.microsoft.com/workshop/author/datatransfer/overview.asp)).
Only text and URLs can be transferred (even in the MSIE drag-and-drop API).
The W3C WebAPI (http://www.w3.org/2006/webapi/) working group's result could be interesting.
But we wish to transfer a mathematical formulae!
Potentially, embedding the OpenMath or MathML encoding as text could work (and does work into Maple, I believe, though the latter still needs a copy-special). However, simple text does not document its content-type and, in particular, does not document the set of symbols. The latter is particularly important to allow transfer to happen between specialized mathematical tools.
Manual solution: drag-and-drop of links and expect drop-recipient to GET link.
Drawback: what's dragged is only a link, no fine-grained feedback on the acceptability of the content (so that a recipient spreadsheet programme could tell a user that this complex set-theoretic statement is not supported).
Major advantage: Content-translation happens only then which means that this (single) translation could be computationally expensive and can be finest tuned.
Try It
ActiveMath copy-and-paste can be tested at work in primitive forms. Use Mozilla, go to a recent demo of ActiveMath (really recent, do ask us for a URL (mailto:activemath@activemath.org)), you should see sub-term selection with your mouse moving. Drag a bit you fix the selection. You can then drag this into the search formula-input-editor (in advanced search) or in exercise inputs (with input-editor activated).
