【问题标题】:Can Mathml put a <mmultiscripts> inside a <mfrac>?Mathml 可以将 <mmultiscripts> 放在 <mfrac> 中吗?
【发布时间】:2015-07-17 10:38:28
【问题描述】:

我正在尝试使用 MathML 在顶部和底部显示带有组合的分数,并使用 nCk 表示法进行组合。如果我这样做是最简单的方法,例如'12c5',我没问题。但是,如果我尝试使用带有下标的斜体大写“C”,就会遇到问题。见http://jsfiddle.net/cx2aks49/2/

这是一段sn-p代码:

<math mathsize='1.5em'>
    <mrow>
        <mfrac>
            <mrow>
                <mi>(
                    <mmultiscripts>
                        <mi mathvariant='italic'>C</mi>
                        <mn>3</mn>
                        <none/>
                        <mprescripts/>
                        <mn>5</mn>
                        <none/>
                    </mmultiscripts>) (
                    <mmultiscripts>
                        <mi mathvariant='italic'>C</mi>
                        <mn>2</mn>
                        <none/>
                        <mprescripts/>
                        <mn>7</mn>
                        <none/>
                    </mmultiscripts>)</mi>
            </mrow>
            <mi>
                <mmultiscripts>
                    <mi mathvariant='italic'>C</mi>
                    <mn>5</mn>
                    <none/>
                    <mprescripts/>
                    <mn>12</mn>
                    <none/>
                </mmultiscripts>
            </mi>
        </mfrac>
        <mo>=</mo>
        <mfrac>
            <mn>35</mn>
            <mn>132</mn>
        </mfrac>
    </mrow>
</math>

有谁知道如何解决这个问题?谢谢。

【问题讨论】:

    标签: html mathml


    【解决方案1】:

    您的 MathML 代码无效。你应该有类似的东西

    <math mathsize='1.5em'>
        <mrow>
            <mfrac>
                <mrow>
                    <mo>(</mo>
                    <mmultiscripts>
                        <mo mathvariant='italic'>C</mo>
                        <mn>3</mn>
                        <none/>
                        <mprescripts/>
                        <mn>5</mn>
                        <none/>
                    </mmultiscripts>
                    <mo>)</mo>
                    <mo>(</mo>
                    <mmultiscripts>
                        <mo mathvariant='italic'>C</mo>
                        <mn>2</mn>
                        <none/>
                        <mprescripts/>
                        <mn>7</mn>
                        <none/>
                    </mmultiscripts>
                    <mo>)</mo>
                </mrow>
                <mmultiscripts>
                    <mo mathvariant='italic'>C</mo>
                    <mn>5</mn>
                    <none/>
                    <mprescripts/>
                    <mn>12</mn>
                    <none/>
                </mmultiscripts>
            </mfrac>
            <mo>=</mo>
            <mfrac>
                <mn>35</mn>
                <mn>132</mn>
            </mfrac>
        </mrow>
    </math>
    

    简短说明:栅栏是运算符(参见http://www.w3.org/TR/MathML3/chapter3.html#presm.mo 的示例),您应该避免mmultiscropts 周围的mo(参见http://www.w3.org/TR/MathML3/chapter3.html#presm.mmultiscripts 的示例)。

    【讨论】:

    • 谢谢,它现在可以工作了,所以看起来你是对的。一个要点:当你说避免mo时,你的意思是避免mi吗?再次感谢。
    • 你应该避免mimomnmmultiscropts附近。我说mo 因为栅栏是运营商,你可以认为只有用mo 替换mi 才能工作。
    猜你喜欢
    • 1970-01-01
    • 2020-12-01
    • 1970-01-01
    • 2013-01-01
    • 2018-12-16
    • 1970-01-01
    • 2016-06-08
    • 1970-01-01
    • 2012-01-04
    相关资源
    最近更新 更多