Question

I'm using mathjax in my site which has Persian language. I follow the instruction in mathjax.org to install and configure it, but the mathjax output is too small in my friend's browser (chrome on Linux) and in normal size in my browser (again chrome on Linux). I know mathjax calculate font size dynamically, but I can't understand why the output differs in same browsers but different machines.

I googled this problem and it seems many people have same problem but none of the given solutions solve my problem. is it because of Persian language surrounding mathjax text?

this link is one of the page in my site which uses mathjax extensively: http://beta.kahu.ir/question/1/%D8%B1%D8%B4%D8%AA%D9%87%DB%8C-%D9%86%D8%B2%D8%AF%DB%8C%DA%A9-%D8%AA%D8%B4%D8%B1%DB%8C%D8%AD%DB%8C-%D9%85%D8%B1%D8%AD%D9%84%D9%87%DB%8C-%D8%AF%D9%88%D9%85-%D8%B3%D8%A7%D9%84-%DB%B1%DB%B3%DB%B9%DB%B2/

Was it helpful?

Solution 2

I suspect that some CSS on the page is affecting the measurements that MathJax is making in order to determine the font's em- and ex-sizes. For example, I did notice that the CSS includes

div {
  overflow: hidden;
}

and that might be the source of the problem (as MathJax uses div's to do its measurements). This also seems to be part of the problem with the MathJax menus (which at times are clipped to show only one item). You could try removing that temporarily and see if the math is sized correctly.

In any case, you can use set matchFontHeights to false in the HTML-CSS section of your MathJax configuration in order to turn off font matching. That seems to work OK with your setup.

OTHER TIPS

In the Mathjax documentation there is a section on local Mathjax fonts and Firefox which might be also helpful for Google Chrome:

copied from the Mathjax site

Firefox and local fonts

Firefox’s same-origin security policy affects its ability to load web-based fonts, as described above. This has implications not only to cross-domain loading of MathJax, but also to using MathJax locally from your hard disk. Firefox’s interpretation of the same-origin policy for local files is that the “same domain” for a page is the directory where that page exists, or any of its subdirectories. So if you use MathJax in a page with a file:// URL, and if MathJax is loaded from a directory other than the one containing the original page, then MathJax will not be able to access the web-based fonts in Firefox. In that case, MathJax will fall back on image fonts to display the mathematics.

In order for Firefox to be able to load the fonts properly for a local file, your MathJax installation must be in a subdirectory of the one containing the page that uses MathJax. This is an unfortunate restriction, but it is a limitiation imposed by Firefox’s security model that MathJax can not circumvent. Currently, this is not a problem for other browsers.

One solution to this problem is to install the MathJax fonts locally, so that Firefox will not have to use web-based fonts in the first place. To do that, either install the STIX fonts, or copy the fonts from MathJax/fonts/HTML-CSS/TeX/otf into your systems fonts directory and restart your browser (see the MathJax fonts help page for details).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top