mathjax / MathJax

Beautiful and accessible math in all browsers
http://www.mathjax.org/
Apache License 2.0
10.22k stars 1.16k forks source link

Characters with diacritical marks inside \\text{} #2401

Closed cebola2 closed 3 years ago

cebola2 commented 4 years ago

Issue Summary

Characters with diacritical marks inside \text{} appear in a font (size?) different from ascii characters. There is a marked difference in Linux. For Windows size is about the same but one can tell it is a different font.

Steps to Reproduce:

Typeset \[f(x)=\begin{cases}\frac{xy}{\sqrt{x^2+y^2}},& \text{ se } (x,y)\neq (0,0),\\ 0, & \text{ caso contrário. éíóúñ}\end{cases}\]

Technical details:

Supporting information:

Captura de ecrã de 2020-04-10 15-03-53

dpvc commented 4 years ago

The issue is actually with mtextInheritFont, which is broken in v3, and hasn't been fixed yet (it is going to require a change to the configuration, and that will be made in v3.1). Technically, this is a duplicate of your #2189 for that reason.

As a fix for now, you could add

mjx-utext {
  font-family: MJXZERO, Noto Sans, sans-serif
}

to your CSS.

The reason that the characters are different sizes is that some are being taken from the MathJax TeX font set, and some from system fonts (when they aren't in the TeX font), and the two don't have the same ex-heights, so they don't match well. MathJax normally adjusted the scaling of its fonts to match the system fonts, but it thinks that all the characters are coming from the surrounding font, which they are not due to a setting on the mathjax container element that can not be removed without damaging the layout.