Forgot password?
 Create new account
View 165|Reply 4

[MathML] Firefox、Chrome、MathJax不同

[Copy link]

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

hbghlyj Posted at 2024-3-18 04:07:09 |Read mode
www-archive.mozilla.org/projects/mathml/demo/tester输入
  1. <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  2.   <mi>dist</mi>
  3.   <mo>&#x2061;</mo>
  4.   <mo stretchy="false">(</mo>
  5.   <mi>e</mi>
  6.   <mo>,</mo>
  7.   <mi>W</mi>
  8.   <mo stretchy="false">)</mo>
  9.   <mo>&#x2A7D;</mo>
  10.   <mrow></mrow>
  11.   <mo fence="true" form="prefix">&#x2016;</mo>
  12.   <mfrac>
  13.     <mn>1</mn>
  14.     <mrow>
  15.       <mi>T</mi>
  16.       <mi>x</mi>
  17.     </mrow>
  18.   </mfrac>
  19.   <mi>e</mi>
  20.   <mo>&#x2212;</mo>
  21.   <mo stretchy="false">(</mo>
  22.   <mi>e</mi>
  23.   <mo>&#x2212;</mo>
  24.   <mi>x</mi>
  25.   <mo stretchy="false">)</mo>
  26.   <mo fence="true" form="prefix">&#x2016;</mo>
  27.   <mo>=</mo>
  28.   <mfrac>
  29.     <mn>1</mn>
  30.     <mrow>
  31.       <mo stretchy="false">|</mo>
  32.       <mi>T</mi>
  33.       <mi>x</mi>
  34.       <mo stretchy="false">|</mo>
  35.     </mrow>
  36.   </mfrac>
  37.   <mo fence="true" form="prefix">&#x2016;</mo>
  38.   <mi>x</mi>
  39.   <msub>
  40.     <mo fence="true" form="prefix">&#x2016;</mo>
  41.     <mi>X</mi>
  42.   </msub>
  43.   <mo>.</mo>
  44. </math>
Copy the Code

用Firefox的效果:
Screenshot 2024-03-17 at 20-07-26 MathML Tester.png
因為在Firefox中<math>的直接子元素<mo>不会拉伸,即使stretchy="true"也不会拉伸,必須放在一層<mrow>裡才会拉伸

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

 Author| hbghlyj Posted at 2024-3-18 04:11:07
同樣, 在www-archive.mozilla.org/projects/mathml/demo/tester输入相同內容。
用Chrome的效果:
Screenshot 2024-03-17 200919.png
可见,与Firefox不同,$\Vert$拉伸了,但最後一個$\Vert$没拉伸,因為套在一層<msub>裡。

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

 Author| hbghlyj Posted at 2024-3-18 04:12:18
mathjax.org/#demo輸入MathML
效果:
Screenshot 2024-03-17 201321.png
可见,与Firefox不同,$\Vert$拉伸了;与Chrome也不同:最後一個$\Vert$也拉伸了。

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

 Author| hbghlyj Posted at 2024-3-18 04:15:33
同樣的一段MathML,在Firefox、Chrome、MathJax效果都不同

3147

Threads

8493

Posts

610K

Credits

Credits
66163
QQ

Show all posts

 Author| hbghlyj Posted at 2024-3-18 04:19:35
hbghlyj 发表于 2024-3-17 20:07
即使stretchy="true"也不会拉伸,必須放在一層<mrow>裡才会拉伸
Firefox這個「必須放在一層<mrow>裡才会拉伸」是Bug,還是有意為之?
似乎Firefox使用的是很早期的MathML標準……

手机版Mobile version|Leisure Math Forum

2025-4-20 22:28 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list