Re: Math on the web

[T. V. Raman]
> MathML has everything you need to do good audio renderings. I've
> been part of the MathML working group since its inception and was an
> active participant in the initial design phase--and have been a
> passive observer since to make sure that the representation was
> adequate for producing multiple presentations.

While I appreciate the effort that's gone into MathML, I think a
static math document type is a mistake.  Moreover, MathML is
schizophrenic about whether it wants to be presentational or
semantic.

MathML's presentational markup can be accessible by voice or touch,
but with a certain amount of ambiguity.  You know that something is
superscripted, or that numbers are positioned one over the other, but
you don't know if the superscript is an exponent or an isotope, or if
the \over is a division or a combinatorial.  (Justify <mphantom> from
an accessibility point of view.)

On the other hand, any static semantic DTD will be ignored by the
scientific and mathematical communities, because new notation is often
introduced to express new ideas.  Moreover, MathML's semantic elements
are infix operators - Knuth thought the \over infix was a bad idea
twenty years ago, and only justified it by technological limitations
that no longer hold.

A better idea, IMO, is to promulgate a markup *methodology* instead of
a DTD, whereby expressions and elements are homologous, and
presentation is in the stylesheet where it belongs.  My markup method
is similar to MathML's semantic <apply> and <relation> elements, but
attempting to enumerate all applications and relations is doomed.
Instead, authors can choose appropriate element type names; even
without a stylesheet, the markup is readable, and the author can
provide a stylesheet that allows for whatever new markup he wishes to
introduce.

As an example, here are Maxwell's equations, in presentational MathML,
semantic MathML, and my own proposal
(<URL:http://www.oreilly.com/people/staff/crism/math/>):

<!-- presentational MathML -->
<mrow>
  <mrow>
    <mi fontslant="plain">&nabla;</mi>
    <mo>&middot;</mo>
    <mi fontweight="bold" fontslant="plain">E</mi>
  </mrow>
  <mo>=</mo>
  <mfrac>
    <mi>&rho;</mi>
    <msub>
      <mi>&epsilon;</mi>
      <mn>0</mn>
    </msub>
  </mfrac>
</mrow>
<mrow>
  <mrow>
    <mi fontslant="plain">&nabla;</mi>
    <mo>&times;</mo>
    <mi fontweight="bold" fontslant="plain">E</mi>
  </mrow>
  <mo>=</mo>
  <mrow>
    <mo>-</mo>
    <mfrac>
      <mrow>
        <mi>&part;</mi>
        <mo>&ApplyFunction;</mo>
        <mi fontweight="bold" fontslant="plain">B</mi>
      </mrow>
      <mrow>
        <mi>&part;</mi>
        <mo>&ApplyFunction;</mo>
        <mi>t</mi>
      </mrow>
    </mfrac>
  </mrow>
</mrow>
<mrow>
  <mrow>
    <msup>
      <mi>c</mi>
      <mn>2</mn>
    </msup>
    <mo>&InvisibleTimes;</mo>
    <mrow>
      <mi fontslant="plain">&nabla;</mi>
      <mo>&times;</mo>
      <mi fontweight="bold" fontslant="plain">B</mi>
    </mrow>
  </mrow>
  <mo>=</mo>
  <mrow>
    <mfrac>
      <mrow>
        <mi>&part;</mi>
        <mo>&ApplyFunction;</mo>
        <mi fontweight="bold" fontslant="plain">E</mi>
      </mrow>
      <mrow>
        <mi>&part;</mi>
        <mo>&ApplyFunction;</mo>
        <mi>t</mi>
      </mrow>
    </mfrac>
    <mo>+</mo>
    <mfrac>
      <mi>j</mi>
      <msub>
        <mi>&epsilon;</mi>
        <mn>0</mn>
      </msub>
    </mfrac>
  </mrow>
</mrow>
<mrow>
  <mrow>
    <mi fontslant="plain">&nabla;</mi>
    <mo>&middot;</mo>
    <mi fontweight="bold" fontslant="plain">B</mi>
  </mrow>
  <mo>=</mo>
  <mn>0</mn>
</mrow>

<!-- semantic MathML -->
<!-- This is impure, as semantic MathML is lacking vector functions
     for the inner or dot product, cross product, divergence, and
     curl.  It also appears to lack a simple negation, in the
     negative-number (as apposed to functional inverse) sense. -->
<relation>
  <eq/>
  <mrow>
    <ci type="vector">&nabla;</ci>
    <mo>&middot;</mo?
    <ci type="vector">E</ci>
  </mrow>
  <apply>
    <divide/>
    <ci>rho</ci>
    <ci>
      <msub>
        <mi>ep</mi>
        <mn>0</mn>
      </msub>
    </ci>
  </apply>
</relation>
<relation>
  <eq/>
  <mrow>
    <ci type="vector">&nabla;</ci>
    <mo>&times;</mo>
    <ci type="vector">E</ci>
  </mrow>
  <apply>
    <minus/>
    <cn>0</cn>
    <apply>
      <partialdiff/>
      <ci type="vector">B</ci>
      <bvar>
        <ci>t</ci>
      </bvar>
    </apply>
  </apply>
</relation>
<relation>
  <eq/>
  <apply>
    <times/>
    <apply>
      <power/>
      <ci>c</ci>
      <cn>2</cn>
    </apply>
    <mrow>
      <ci type="vector">&nabla;</ci>
      <mo>&times;</mo>
      <ci type="vector">B</ci>
    </mrow>
  </apply>
  <apply>
    <plus/>
    <apply>
      <partialdiff/>
      <ci type="vector">E</ci>
      <bvar>
        <ci>t</ci>
      </bvar>
    </apply>
    <apply>
      <divide/>
      <ci>j</ci>
      <ci>
        <msub>
          <mi>ep</mi>
          <mn>0</mn>
        </msub>
      </ci>
    </apply>
  </apply>
</relation>
<relation>
  <eq/>
  <mrow>
    <ci type="vector">&nabla;</ci>
    <mo>&middot;</mo>
    <ci type="vector">B</ci>
  </mrow>
  <cn>0</cn>
</relation>

<!-- my proposal -->
<equations>
  <equation> <!-- equation sets its children equal to each other -->
    <divergence>
      <vector>E</vector>
    </divergence>
    <divide> <!-- divide divides its first child by its second -->
      <variable>&rho;</variable>
      <indexed-variable>
	<variable>&epsilon;</variable>
	<constant>0</constant>
      </indexed-variable>
    </divide>
  </equation>
  <equation>
    <curl>
      <vector>E</vector>
    </curl>
    <negation>
      <partial-differential> <!-- partial-differential is of the first
                                  child with respect to the second -->
	<vector>B</vector>
	<variable>t</variable>
      </partial-diffential>
    </negation>
  </equation>
  <equation>
    <multiply>
      <exponent> <!-- exponent is first child to the power of the
                      second -->
	<variable>c</variable>
	<constant>2</constant>
      </exponent>
      <curl>
	<vector>B</vector>
      </curl>
    </multiply>
    <add>
      <partial-differential>
	<vector>E</vector>
	<variable>t</variable>
      </partial-differential>
      <divide>
	<vector>j</vector>
	<indexed-variable>
	  <variable>&epsilon;</variable>
	  <constant>0</constant>
	</indexed-variable>
      </divide>
    </add>
  </equation>
  <equation>
    <divergence>
      <vector>B</vector>
    </divergence>
    <constant>0</constant>
  </equation>
</equations>

Received on Thursday, 19 February 1998 14:14:16 UTC