mathjax / MathJax-node

MathJax for Node
Apache License 2.0
615 stars 97 forks source link

options for tweaking font fallback behavior #299

Closed pkra closed 6 years ago

pkra commented 7 years ago

From https://github.com/mathjax/MathJax-dev/issues/22#issuecomment-282081720

MathJax-node can't measure the width of elements, like MathJax can in the browser. [...] So MathJax-node has to guess. It does this by using the "monospace" font, and making an assumption about the width of that font. For standard ASCII characters, this assumption is reasonable, but for non-western characters, this doesn't work so well.

You can adjust the width that MathJax-node uses by changing the 8.5 in line 318 of lib/mj-single.js to be something larger; a value of 13 worked for me. If you change the monospace to serif two lines later, then you might need to go to 15 or 16.

I'm wondering: Should we expose this in the configuration options?

dpvc commented 7 years ago

Fine by me, if you want to take time to do it and maintain it.

pkra commented 6 years ago

This was fixed by #358.