- From: Robert Miner <RobertM@dessci.com>
- Date: Mon, 19 Apr 2004 15:23:09 -0500
- To: paul@activemath.org
- Cc: www-math@w3.org
Hi. > Interesting. > (I presume it only works with WebEQ "installed" in the VM-extensions > for permission purposes) Right. That's life with applets. > This seeems to have a drawback: people would only see that you copy > content if they "select correctly" which is somewhat random depending > on the difficulty in selecting... > > My favourite example where visual selection can have problems with > "content-selection" is the "3 = -2 mod 5": if you have operator > selection (i.e. you can select an operator without its operands, a > highly wished feature) then you should be able to select the "mod" but > you should only be able to do so by selecting at the same time the "=" > as, at least in classical semantic of such an expression, the operator > "... = ... mod ..." is the operator and not just the "=". > > What does WebEQ do then ? The way the WebEQ Viewer works is as follows: When a content expression is parsed, WebEQ creates two trees. One is the parse tree for the content, and the other is the presentation markup to display. Behind the scenes, these corresponding nodes in these trees are cross-linked. Selection then operates on the presentation tree, so that selection is "visually intuitive". If the selection is a subtree in the presentation markup whose root corresponds to a subtree in the content markup, the content markup is returned. This is the situation where the selection is mathematically meaningful (hopefully). If the selection doesn't correspond to a content subtree, then the presentation is returned, on the hypothesis that what you wanted was markup for what you visually selected. It's a bit more complicated than that, since the selection might be a collection of subtrees, all of which correspond to content expressions, etc. But that gives the basic idea. In the specific case of your 3 = -2 mod 5 example, WebEQ Viewer will do the wrong thing, since it's semantics aren't nearly that subtle. If the content markup was <math> <apply> <eq/> <cn>3</cn> <apply> <rem/> <cn>-2</cn> <cn>5</cn> </apply> </apply> </math> then the corresponding presentation tree will be <math> <mrow> <mn>3</mn> <mo>=</mo> <mrow> <mn>-2</mn> <mo>mod</mo> <mn>5</mn> </mrow> </mrow> </math> If you select "mod", you will get <rem/> since that corresponds to the <mo>mod</mo> presentation subtree. If you select "-2 mod" you will get "<cn>-2</cn><rem/>" (a collection of corresponding subtrees, not very ideal in this case I admit) If you select "-2 mod 5", the viewer is smart enough to include the mrow in the selection, and you get <apply> <rem/> <cn>-2</cn> <cn>5</cn> </apply> for the selection. Hope this helps. --Robert ------------------------------------------------------------------ Dr. Robert Miner RobertM@dessci.com W3C Math Interest Group Co-Chair 651-223-2883 Design Science, Inc. "How Science Communicates" www.dessci.com ------------------------------------------------------------------
Received on Monday, 19 April 2004 16:24:00 UTC