【问题标题】:MathML not rendering/reading/respondingMathML 不呈现/读取/响应
【发布时间】:2015-11-29 01:07:38
【问题描述】:

首先,我想与你分享这行,我认为它的格式适合 MathML:

[ [ 33, -13, -19 ], [ -9.75, 22.75, -12 ], [ -23.75, -20, 44.75 ] ] 有两个反引号,以防stackoverflow呈现它们,这样你就看不到它们了……1在第一个[之前,一个在最后一个之后,关闭]。

另一个重要的事情是我需要动态更新这个表达式。我的意思是 - 不是 onload() 而是之后和相对频繁(不止一次等等......)。我只是假设 MathML 的渲染和页面加载之间存在加载时连接,我想页面加载会触发数学事物的解析器...... 所以,如果格式没问题,我想知道可能有什么问题。我愿意接受任何建议。 :D

【问题讨论】:

  • 可以在问题中包含html 吗?
  • ` [
    我通过 for 循环形成表达式。然而,这实际上并不重要,因为 MathML 最感兴趣的是最终结果,然后是达到它的方式......应该是。
  • 好的,现在我将阅读它,但我想提一点。我试图得到结果——我在上面的主帖上发布的表达式——并将它放在一个 div 中。所以在这个阶段,我有一个 div,其中 for 循环复合表达式,另一个 div 直接保存表达式,没有任何预计算、循环等。结果是 - 第一个 div 不通过 MathML 呈现,第二个被正确格式化!这证明了我关于渲染的 onload 触发的初步理论...... @guest271314 我现在将检查你提出的内容。 :)

标签: jquery formatting mathjax mathml


【解决方案1】:

首先,我想与您分享这行,我认为它的格式适合 MathML:

[ [ 33, -13, -19 ], [ -9.75, 22.75, -12 ], [ -23.75, -20, 44.75 ] ]

这一行不是 MathML。如果你试图表示一个矩阵,MathML 代码是

<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><mtable><mtr><mtd columnalign="center"><mn>33</mn></mtd><mtd columnalign="center"><mo>−</mo><mn>13</mn></mtd><mtd columnalign="center"><mo>−</mo><mn>19</mn></mtd></mtr><mtr><mtd columnalign="center"><mo>−</mo><mn>9.75</mn></mtd><mtd columnalign="center"><mn>22.75</mn></mtd><mtd columnalign="center"><mo>−</mo><mn>12</mn></mtd></mtr><mtr><mtd columnalign="center"><mo>−</mo><mn>23.75</mn></mtd><mtd columnalign="center"><mo>−</mo><mn>20</mn></mtd><mtd columnalign="center"><mn>44.75</mn></mtd></mtr></mtable></math></p>

以及 MathJax 需要的 LaTeX 代码

\begin{matrix}
  33 & -13 & -19 \\
  -9.75 & 22.75 & -12 \\
  -23.75 & -20 & 44.75
\end{matrix}

如果你想渲染你在问题中输入的那一行,MathML 代码是

<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mo stretchy="false" form="prefix">[</mo><mo stretchy="false" form="prefix">[</mo><mn>33</mn><mo>,</mo><mo>−</mo><mn>13</mn><mo>,</mo><mo>−</mo><mn>19</mn><mo stretchy="false" form="postfix">]</mo><mo>,</mo><mo stretchy="false" form="prefix">[</mo><mo>−</mo><mn>9.75</mn><mo>,</mo><mn>22.75</mn><mo>,</mo><mo>−</mo><mn>12</mn><mo stretchy="false" form="postfix">]</mo><mo>,</mo><mo stretchy="false" form="prefix">[</mo><mo>−</mo><mn>23.75</mn><mo>,</mo><mo>−</mo><mn>20</mn><mo>,</mo><mn>44.75</mn><mo stretchy="false" form="postfix">]</mo><mo stretchy="false" form="postfix">]</mo></mrow></math></p>

我只是假设 MathML 的渲染和页面加载之间存在加载时连接。

这在原生 MathML 支持的场景中没有任何意义。

我想页面加载会触发数学解析器...

如果您使用 MathJax,他们的 Javascript 将在页面加载后触发解析器。如果您想动态更改某些内容,请阅读http://docs.mathjax.org/en/latest/typeset.html

【讨论】:

    猜你喜欢
    • 2015-04-17
    • 1970-01-01
    • 1970-01-01
    • 2018-05-16
    • 2011-04-07
    • 2014-02-05
    • 2015-06-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多