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

Re: minor suggestions on Public Editor's draft of MathML

From: David Carlisle <davidc@nag.co.uk>
Date: Thu, 17 May 2012 17:03:41 +0100
Message-ID: <4FB5215D.9020209@nag.co.uk>
To: Joe Java <cop3252@yahoo.com>
Cc: "www-math@w3.org" <www-math@w3.org>
On 17/05/2012 16:24, Joe Java wrote:

> Realistically, the vast majority of people will use the hypen-minus
> character, but the defining document for MathML should be pedantic
> and use the defined minus character.

Being pedantic implies that using <mo>-</mo> is wrong, or that at least
<mo>&minus;</mo> is preferable. But I don't think it is. I think that
either is perfectly acceptable (and equivalent).

> Most people do not even know that the hypen-minus character is not
> the same size as the minus character. To see this, place text on both
> sides of a plus character then toggle the plus character with a minus
> sign. If you use the hypen-minus character the text around the minus
> will move, but if you use the minus character, it will not move. The
> hypen-minus character is smaller than the minus character. The minus
> character is defined to be the same width as the plus character.

If you see a visible difference then your mathml renderer is doing it
wrong. What you describe is of course what will happen if you use the
character in plain text, as the hyphen character is typically shorter
than the minus sign. But hyphen-minus is supposed to render as a hyphen
in text and as a minus in math.



>
>> I wondered about that in the html version but.... For older
>> browsers (including current Opera unless you have a test version I
>> think) that do not pre-define the full html5 entity set the
>> characters would be mis-parsed if I used entity references.
>
> Latest Opera seems to have all the pre-defined HTML5 entities.
Ah. I have that installed, will check. I've been using an "opera labs"
version as well so I may have got confused. I'd also need to check what
happens on (say) IE8.

> Browser support of HTML5 is actually pretty good.

well yes, which is why I thought now was a good time to release this
version, but still not everyone is running the latest browser so it's
good to use the html5 features where they fall back gracefully.

>
> The HTML5 defining document has a nice named character references
> chart that shows entity name, Unicode number, and a sample glyph of
> the character.
> http://www.whatwg.org/specs/web-apps/current-work/multipage/named-character-references.html
>
>
>
Hixie generates that from the same unicode.xml file that sits behind
this document and the xml entities document.

> I am assuming most people will simply look at the chart for the
> character they want and use the entity name to add it. To make life
> easier for these people the MathML examples should use these entity
> names.

As I say I nearly did this anyway, so I could be persuaded it was a good
idea:-) I'll pass it past the working group.

The main disadvantage, and the reason why we changed at MathML3 to
display the numeric reference is that it means that the fragments are in
themselves not well formed. So in an HTML(5) context it is fine as the
entities are not well formed but if you cut and paste that fragment to a
system expecting MathML as well formed XML then you get a fatal parse
error. Use of numeric references avoids this (very real) problem.

chapter 7 warns about this:

>  Using entity references: The MathML DTD defines internal entities that
>                      expand to character data. Thus for example the entity reference
>                      &amp;eacute; may be used rather than the character reference
>                      &amp;#xE9;. An XML fragment that uses an entity
>                      reference which is not defined in a DTD is not well-formed; therefore
>                      it will be rejected by an XML parser. For this reason
>                      every fragment using entity references must
>                      use a DOCTYPE declaration which specifies the MathML DTD, or a DTD
>                      that at least declares any entity reference used in the MathML
>                      instance.  The need to use a DOCTYPE complicates inclusion of MathML in
>                      some documents. However, entity references can be useful for small
>                      illustrative examples.
>

Even if you are reading the html version of the spec, you may be wanting 
to use with a system requiring xml...


David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________
Received on Thursday, 17 May 2012 16:04:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 17 May 2012 16:04:17 GMT