benweet / stackedit

In-browser Markdown editor
https://stackedit.io/
Apache License 2.0
21.69k stars 2.72k forks source link

MathJax rendering of stars and asterisks #373

Open endolith opened 10 years ago

endolith commented 10 years ago

Example from https://en.wikipedia.org/wiki/Cross-correlation#Properties TeX is

(f * h) \star g = h(-)*(f \star g)

Should render something like this:

Wikipedia's PNG

TeXRendr.com uses MathJax, and it looks similar:

2014-04-09 15_18_46-texrendr com _ browser-based real-time tex_latex visualization write see sh

but in stackedit, with MathJax, it looks like this:

2014-04-09 15_26_44-stackedit

The 5-pointed stars are small, and the asterisks are 5-pointed, too, making them hard to tell apart. Is this because it's using a different font than TeXRendr or something?

benweet commented 10 years ago

What browser/OS? I have it rendered correctly on chrome/OSX.

endolith commented 10 years ago

Firefox 28.0 in Windows 7. Tried it in Chrome and it looks good there.

benweet commented 10 years ago

I can't reproduce that on Firefox/OSX. I will try on Windows when I get a chance.

endolith commented 10 years ago

Also looks good in Internet Explorer on Windows 7.

Also not a problem in a clean Firefox profile, so it must be my fault, some add-on or setting is affecting it. I don't know why it would work in TeXRendr but not here though. I tried disabling Greasemonkey, Stylish, Adblock, HTTPS Everywhere, flashblock, and it still doesn't show up right in my normal profile. I don't know what's causing it.

pkra commented 10 years ago

@endolith have you set the MathJax rendering option to native MathML output? (Right click an equation => math settings => math renderer).

That would explain it (and I can reproduce it that way). That would make it a Firefox "issue" (because MathJax hands over rendering to Firefox instead of polyfilling MathML). But I think it's just a font issue -- installing the MathJax fonts or STIX-general fonts should fix it (e.g. the Firefox extension for math fonts).

endolith commented 10 years ago

No, the math renderer is HTML-CSS. Using "Show fonts in selection" firefox extension:

On texrendr.com and math.stackexchange.com, the 6- and 5-pointed stars are displayed in MathJax_Main-Regular font, the "−" is shown using MathJax_Main-Regular.

On stackedit.io, the stars are displayed using Segoe UI Symbol, and the "−" is displayed using Times New Roman.

The "f g h" are MathJax_Math-Italic on all 3 sites.

So the fonts are accessible by the browser, they just aren't being used on this particular site.

My editor font setting is non-default DejaVu Sans Mono, Menlo, Consolas, "Courier New", Courier, monospace if that has anything to do with it

pkra commented 10 years ago

@endolith that's very strange. MathJax only works with a handful of fonts and stackedit is configured to use the default (MathJax_Math-*). Have you tried resetting stackedit and clearing MathJax from the browser cache?

endolith commented 10 years ago

Yes, I cleared browser cache and reset the application, but no change.

The HTML is identical except for the id= numbers, and Firebug says the computed style is font-family MathJax_Main, but Font Information says the same element is rendered using Segoe UI Symbol.

With all extensions disabled in Safe Mode, it still doesn't work right, but with a blank profile it does. I don't get it. :/

pkra commented 10 years ago

I'm afraid I cannot reproduce this on Saucelabs (Win7, FF28, see https://saucelabs.com/tests/d0e61f6c881246d2be5381f8a63c683d).