Accented characters are smaller than surrounding text

33 views
Skip to first unread message

Kyle S

unread,
Nov 14, 2016, 4:11:04 PM11/14/16
to MathJax Users
Hi all,

I'm working with equations that have been translated into French, with accented characters. Those characters appear smaller than the surrounding text. For example, this MathML:

<math>
<msub>
<mrow>
<mi>P</mi>
</mrow>
<mrow>
<mtext>caractéristique</mtext>
</mrow>
</msub>
</math>

Is rendered like this:

 The difference is more noticeable at some font sizes, less for others. It looks like what triggers this is setting a font-family for the page:

body {
   font-family:"Helvetica Neue",Arial,sans-serif;
}

If I remove that from our CSS (or set font-family:serif), all characters render at the same height, but everything is a bit smaller:

 


Is there a good way to fix this? I can't simply remove our font-family declaration for the page. I thought about wrapping all equations in <div>s or <span>s, then declaring font-family:serif on those divs. but, we'd have to touch a lot of existing pages to add those spans/divs. It wouldn't really be practical.

 

Davide Cervone

unread,
Nov 14, 2016, 6:49:14 PM11/14/16
to mathja...@googlegroups.com
The reason for this is that the MathJax fonts do not include glyphs for the accented characters, and so when you use one, it has to fall back on system fonts to obtain the needed characters.  These don't always match the MathJax fonts very well, as you have seen, and that result can depend on the surrounding font.  

There are several approaches to the problem.  First, the CommonHTML output handles this better than the HTML-CSS output, so you could try that instead.  Second, you can set the mtextFontInherit option to true, so the all the characters in <mtext> elements will be taken from the surrounding font (not just the ones MathJax doesn't have internally).  See 


for details of how to set that in your configuration.

Third, you could set the unknownFamily option to include a font that works better, but it already includes serif, so that may not help.

I think your best bet is mtextFontInherit:true.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages