W3C home > Mailing lists > Public > www-math@w3.org > May 2005

Re: How to mark up the minus sign in MathML correctly?

From: Jyrki Kajala <Jyrki.Kajala@savonia-amk.fi>
Date: Wed, 11 May 2005 14:29:13 +0300
Message-Id: <s28216c8.061@gw1.pspt.fi>
To: <mikko.rantalainen@peda.net>, <www-math@w3.org>

Hi Mikko,

I have written a page based on the inputControl-applet by Design
Science:
http://dmath.savonia-amk.fi/scJK/public/toolbars/toolbarsEn.jsp
That renders a*(-b) into
<math>
<mrow>
<mi>a</mi>
<mo>*</mo>
<mo>(</mo>
<mo>-</mo>
<mi>b</mi>
<mo>)</mo>
</mrow>
</math>
 
--Jyrki

>>> Mikko Rantalainen <mikko.rantalainen@peda.net> 05/11/05 11:36 AM >>>

I'm trying to generate MathML automatically from simple text syntax 
and I'm wondering which is the correct markup.

Given source text like

b * (-a)

my current implementation generates

<math xmlns="http://www.w3.org/1998/Math/MathML">
   <mrow>
     <mi>b</mi>
     <mo>&it;</mo><!-- or &sdot; -->
     <mrow>
       <mo>(</mo>
       <mo>&#8722;</mo><!-- $$ -->
       <mi>a</mi>
       <mo>)</mo>
     </mrow>
   </mrow>
</math>

I'm wondering if the location marked with $$ is ok? Should another 
symbol be used for minus sign when its intent is to describe 
"negation of a" instead of "minus operator followed by a"? Or should 
the renderer use short minus sign automatically even though I use 
&#8722;? At least Mozilla renders long and ugly minus sign here.

On the other hand

b - a

generates

<math xmlns="http://www.w3.org/1998/Math/MathML">
   <mrow>
     <mi>b</mi>
     <mo>&#8722;</mo>
     <mi>a</mi>
   </mrow>
</math>

which looks good at least in Mozilla.

-- 
Mikko
Received on Wednesday, 11 May 2005 11:29:27 GMT

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