MathJax <msup> 字体修改

MathJax <msup> font modificaion

我正在尝试使用 mathjax 在 html5 中实现一些数学运算 expressions/equations。当使用 标签时,根据 exponent/power 是什么,我的字体样式会出现不一致的行为。是否有我可以在 标签或 / 标签上实现的属性,以保持 power 与其基本字体相同?或者保持字体样式一致的其他选项?

<math><mrow><msup><mi></mi><mi>x</mi></msup></mrow></math>

<math><mrow><msup><mi></mi><mi>-x</mi></msup></mrow></math>

我在这个问题中实施 mathjax 失败,所以这里有一个 link 的 jsfiddle 来说明我的问题

http://jsfiddle.net/ez5kqv7x/

从 OP 看不太清楚,但它可能指的是 <mi>x</mi> 将排版为斜体,而 <mi>-x</mi> 将呈现 normal/upright。

这是 MathML Spec<mi> 的预期结果:

The default is "normal" (non-slanted) unless the content is a single character, in which case it would be "italic".

对于标识符,人们可能会将其标记为 <mo form="prefix">-</mo><mi>x</mi>,在这种情况下,x 将再次变为斜体;但也许 x 确实是一个数字,在这种情况下 <mn>x</mn><mn>-x</mn> 都将是排版 normal/upright.