Closed lyxabymxlc closed 3 years ago
The default MathJax fonts don't include the U+224C character, so that is why you get a <text>
element for that. You re correct that it will look different in different fonts, and MathJax won't know how much space to leave for it, so that is not optimal.
There are two possible solutions. First, you could switch to the STIX-web font rather than the default MathJax fonts, since they include many more characters, includuing U+224C. Then define cong: '\u224C'
(do not use the braces as that will alter the spacing).
Alternatively, if you want to stick with the default MathJax fonts, you could use
cong: '\\stackrel{\\Large\\lower.2em\\backsim}{\\lower.1em=}'
which will use the back-sim character over an equal sign. That will give you a symbol that looks correct, but will not be read correctly by screen readers.
@dpvc We have tested the font "STIX-web", the congruent symbol "≌" is normal, but the rendered other letter styles do not meet the requirements. Default Font ( Tex ): STIX-web Font:
Using "stackrel" mode, the display is normal in SVG and abnormal in web page.
Finally, we adopt the "stackrel" approach to solve the SVG problem first. As for the web page, we will not make any changes for the time being. Thank you very much. ^_^
Note that mathjax-node uses MathJax version 2, while the mathjax.org website uses MathJax version 3. Apparently, there is some inconsistency in the layout of \stackrel
between the two versions. I will need to check into that. Since you were using MathJax-node, I gave you a version 2 solution. Are you using version 3 in your website? If so, you could use
\stackrel{\raise.03em{\Large\backsim}}{\smash{\lower.1em=}}
for SVG output. There also seems to be inconsistency between the SVG and CHTML output (in both v2 and v3). If you use CHTML output in v3, you should need to use
\stackrel{\lower.2em{\Large\backsim}}{\smash{\lower.1em=}}
instead.
I see. Thank you very much!
I forgot to mention:
the rendered other letter styles do not meet the requirements.
Not everyone likes the look of the STIX fonts, and they are different from the default MathJax TeX fonts, which are based on the TeX Computer Modern fonts (whereas STIX is supposed to be compatible with the Times font, if I recall correctly). But they do have the advantage of having much greater character coverage, so they help when you want to use characters that aren't in the MathJax TeX fonts. It is a choice you have to make one way or the other.
Question: In SVG, the congruent symbol rendered by latex
\cong
is opposite to the Chinese national standard.\cong
after rendering is:≅
. The Chinese national standard is:Environment: mathjax-node: 2.1.1 mathjax: 2.7.6 System: Win10 / Centos
Code:
Through comparison, it is found that:
\cong
after rendering is:≅
. Unicode is\u2245
. The Chinese national standard is:≌
. Unicode is\u224C
. I try to add the following code undermathjax - > tex - > macro
:cong: '{≌}'
But it's not ideal. Looking at SVG, we find that≌
is rendered into thetext
tag, as follows:This will cause the display effect of the character
\u224c
to be inconsistent in different fonts. I want to get the display effect of congruent symbols in Chinese national standard. What should I do?