MathML not rendering arrows and other symbols
Number of replies: 8I have tested this page: http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.html
and the cells corresponding to those symbols are empty (everything else is displayed correctly). In Moodle, I get empty spaces as well for those symbols. I have installed the most recent STIX fonts from mozilla.org.
Does anyone else have this problem? What's wrong? Is there a workaround for the arrows?
Nicola
PS: this is the value of the font.mathfont-family attribute in Firefox: STIXNonUnicode, STIXSize1, STIXGeneral, Symbol, DejaVu Sans, Cambria Math.
Re: MathML not rendering arrows and other symbols
I've tried to display a page with LaTeXMathML in Firefox and it correctly renders those symbols. I conclude that the issue is related to ASCIIMathML (I've tried with different versions with the same result).
The following is minimal self-contained code to show the problem (ASCIIMathML.js must be in the same directory as this file):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<title>Do you see the arrows?</title>
<script type="text/javascript" src="ASCIIMathML.js"></script>
</head>
<body>
<p>Here I see an arrow: `A rArr B`</p>
<p>Here I don't see it: `A rarr B`</p>
<body>
</html>
Attached you find the output. Am I the only one to have this problem?
Nicola

Re: MathML not rendering arrows and other symbols
Maybe your Mac or the Mac fonts listed first do not support symbol → or show empty space instead of arrow
Try if this page (some of your local fonts) show the symbol
Or some missing ',' etc somewhere in your script ? For example here
{input:"rarr", tag:"mo", output:"\u2192", tex:"rightarrow", ttype:CONST},
My PC shows arrows ok but I don't have a Mac to test it at home...
Re: MathML not rendering arrows and other symbols
I've made another test, with the following code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Do you see the arrows?</title>
<script type="text/javascript" src="ASCIIMathML.js"></script>
</head>
<body>
<p>Left/right double arrows: `A lArr B rArr C`</p>
<p>Simple arrows: `A uarr B larr C darr D rarr E`</p>
<p style="font-family:STIXGeneral">Styling with STIX: `A uarr B larr C darr D rarr E`</p>
<p>Using entity name (default font): ↑ ← ↓ →</p>
<p style="font-family:STIXGeneral">Using entity name (STIX fonts): ↑ ← ↓ →</p>
<p>Using numbers (default font): ↑ ← ↓ → </p>
<p style="font-family:STIXGeneral">Using numbers (STIX fonts): ↑ ← ↓ → </p>
</body>
</html>
Attached you see how it is rendered in Firefox and Safari (using fallback). Note, however, that the following code is displayed fine by Firefox:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<body>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mi>A</mi>
<mo>→</mo>
<mi>B</mi>
</math>
</body>
</html>
Also changing the value of font.mathfont-family in several ways has served no purpose. The only thing I can think of is a bug in the Mac version of Firefox, although googling around has brought me nowhere.

Re: MathML not rendering arrows and other symbols
Re: MathML not rendering arrows and other symbols
One possible reason could be that Mac has some problems with document encoding.
If you try to change the encoding of asciimathml script and your document from ANSI to UTF-8 with some texteditor does it change the situation?
By the way, Marc, if we change encoding of asciimathml scripts from ANSI to UTF-8 we can use unicode characters directly instead of javascript escapes so for example
{input:"rarr", tag:"mo", output:"\u2192", tex:"rightarrow", ttype:CONST},
can be
{input:"rarr", tag:"mo", output:"→", tex:"rightarrow", ttype:CONST},
I wonder if Peter and David have noticed this ?
Re: MathML not rendering arrows and other symbols
I've tried changing the encoding of both the script and in Firefox preferences in several ways and I've even added a meta tag to specify the encoding in the xhtml page. No way.
I think that the Firefox dev list is the appropriate place for this problem. I will redirect my question there, as suggested (thanks for pointing out that mailing list).
Thanks for finding the time to reply. My apologies for stealing time of productive development ;)
Re: MathML not rendering arrows and other symbols
Though stix are still not finalized and I still get some errors because of font artifacts - there needs to be a BIG PUSH to address some of the underlying issues
Re: MathML not rendering arrows and other symbols
I will test this next week - if you see characters like javascript escape \u2192 you should see also the actual unicode character →
It's just a lot shorter to write the character instead of \u2192 (you save 5 characters per each output value) and if the script file itself is saved as utf-8 you will also see the actual characters in input/output tables...
That font issue is important if we use characters that do not exist in most common fonts.