W3C home > Mailing lists > Public > www-math@w3.org > June 2007

linebreaking mathml

From: Bruce Miller <bruce.miller@nist.gov>
Date: Tue, 05 Jun 2007 01:49:54 -0400
To: www-math@w3.org
Message-id: <4664F982.3010204@nist.gov>

Hi all;
  I suppose that when MathML was originally developed,
the authors imagined that the browser would be responsible
for line breaking.  After all, it _does_ seem like the
right place; who else knows the font sizes, window width
and such?
  Alas, apparently linebreaking is a bit too demanding
for real time; rendering MathML is slow enough as it is.
Mozillae will linebreak only at the topmost level, under
very limiting circumstances.  I haven't (re)checked exactly
what MathPlayer does.

So, I set out to pre-linebreak my mathml to at least a
not-unreasonable width, and started looking for the
right markup bits (we're talking presentation MathML here).

The first strategy I found is to insert
  <m:mspace linebreak="newline"/>
Or even better, linebreak="indentingnewline", although
the spec doesn't (yet ! :> ) indicate what it
should indent _to_  (a fixed amount, to the begin
of the containing row, something else ? ).
Unfortunately, Mozilla doesn't implement that.

OK, second strategy: split a row into rows of an
mtable. Which almost works, but the align attribute
of mtable seems to miss a useful value for this
case.  Namely, I would like to align the table so
that the 1st row's baseline aligns with the
baseline of material on the left (like align="baseline1" ).
However, I would like the following material to
align with the last row (like align="baseline<n>" ).
Like this:
   a + (b + c + d
         + e + f + g) + h

Lacking that, I've got to assure that the broken mrow
is the last on it's line (move the "+ h" to the next line),
and/or be very careful (& somewhat contrived) when nesting mrows.

Would such an alignment value be useful?
(and would it ever be implemented? )

Or have I overlooked a better linebreaking strategy?

-- 
bruce.miller@nist.gov
http://math.nist.gov/~BMiller/
Received on Tuesday, 5 June 2007 05:50:25 GMT

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