Re: Inserting text with MathML

Hi Derek,

There are basically two ways to integrate math and text.  The first
way is to mix the MathML with some other document oriented markup
language like HTML.  Thus,
your example would get encoded as

<p>What does <math>....</math> calculate to?</p>

The up side is that this is really how MathML is intended to be used.
The down side is that it is a pain to get a browser to display this
properly.  As you presumably know, to display this with WebEQ you
would need to pass the MathML as a parameter in an applet tag, and
getting the dimension of the applet to match the equation is a pain.

The alternative is to abuse the MathML <mtext> element, and force the
surrounding text to be part of the equation.

  <mtext>What does </mtext>
  <mtext> calculate to ?</mtext>

The up side of this method is that then your question is self
contained, and can be displayed in a single applet or plug-in.  The
down side is that you will probably end up tweaking the spacing
between the text and the equation (using named spaces like &thinsp;
since plain whitespace in MathML gets telescoped), and it doesn't
scale very well.

Hope this helps.


Robert Miner                          
MathML 2.0 Specification Co-editor                    651-223-2883
Design Science, Inc.   "How Science Communicates"

Received on Wednesday, 11 April 2001 14:40:50 UTC