W3C home > Mailing lists > Public > www-math@w3.org > September 2009

stretching in both directions [was Operator Dictionary MathML 2 vs. MathML 3]

From: Karl Tomlinson <w3@karlt.net>
Date: Thu, 24 Sep 2009 10:35:59 +1200
To: www-math@w3.org
Cc: Frédéric WANG <fred.wang@free.fr>, neils@dessci.com
Message-ID: <877hvpl25s.fsf_-_@karlt.net>
Neil Soiffer writes:

> 2.  this is a default -- if someone specifies that they want a large
> operator or other character to stretch, the renderer should do so if
> it can.
>
> The later point is really important -- please try to implement
> 'stretchy' for as many characters as you can.  That includes large
> ops, fences, arrows, ...  IMHO,  it is far more important that if
> someone specifies stretchiness (on or off), that the renderer does
> that because the author is specifically stating their desire.
> Obviously though, you will be limited by the fonts available, and
> chapter 3 makes that limitation clear.

This is consistent with
http://monet.nag.co.uk/~dpc/draft-spec/chapter3.html#presm.op.stretch

 "There is no provision in MathML for specifying in which
  direction (horizontal or vertical) to stretch a specific
  character or operator; rather, when stretchy="true" it should be
  stretched in each direction for which stretching is possible. It
  is up to the renderer to know in which directions it is able to
  stretch each character. (Most characters can be stretched in at
  most one direction by typical renderers, but some renderers may
  be able to stretch certain characters, such as diagonal arrows,
  in both directions independently.)"


With what Frédéric is implementing, it could be possible to stretch
any (single character) operator in either direction.

This gets especially interesting if the operator "is the sole
direct sub-expression of an mtd element" in some row and column of
a table, because the operator should be stretched in both
directions.  ATM Mozilla (incorrectly) doesn't stretch operators
that are a sole child of a table cell, but I'd like to check the
correct behavior here.

If I am reading the spec correctly, the follow vertical arrow should
stretch both horizontally and vertically.

<mtd>
  <mo stretchy="true">&UpArrow;<mo>
</mtd>

If the author wishes the arrow to be stretched only vertically,
should they express that differently?  Perhaps by enclosing the
operator in some parent element, or adding an invisible child
element to the mtd?  But then the arrow wouldn't stretch to the
full height of the mtd.

Note that enclosing the mo in an mrow shouldn't imply only
vertical stretching due to the "<mrow> of one argument" rule:
http://www.w3.org/TR/MathML3/chapter3.html#id.3.3.1.3.1

When stretchy="true" is not explicitly specified, I'm imagining an
implementation that only stretches in the expected direction by
having the renderer choose which directions to stretch by default
based on the operator.

But should I be concerned about unexpected behavior if
stretchy="true" is explicitly specified?

Should the renderer be expected to keep of list of all the
operators that it will respect the stretchy request and in which
directions it will respect the request?
Received on Wednesday, 23 September 2009 22:36:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 20 February 2010 06:13:05 GMT