How to mark up the minus sign in MathML correctly?

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>&minus;</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 
&minus;? 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>&minus;</mo>
     <mi>a</mi>
   </mrow>
</math>

which looks good at least in Mozilla.

-- 
Mikko

Received on Wednesday, 11 May 2005 08:35:05 UTC