MathML stretchy属性のメモ

Word に MathML を貼り付けた時に,sum演算子の表現が stretchy属性によって異なり,困ってしまったので覚え書きメモ.

stretchy属性

stretchy属性 は MathML の演算子を表す <mo> 要素の属性の1つ.

この演算子のサイズを前後の要素に合わせて調整するかを決定する.

stretchy=”true” の場合

sum演算子のサイズが前後の要素に合わせて調整される.

<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
    <mml:mrow>
        <mml:msub>
            <mml:mo stretchy="true">∑</mml:mo>
            <mml:mrow>
                <mml:mi>i</mml:mi>
            </mml:mrow>
        </mml:msub>
        <mml:mrow>
            <mml:mrow>
                <mml:msub>
                    <mml:mo stretchy="true">∑</mml:mo>
                    <mml:mrow>
                        <mml:mi>k</mml:mi>
                    </mml:mrow>
                </mml:msub>
                <mml:mrow>
                    <mml:mi>a</mml:mi>
                </mml:mrow>
            </mml:mrow>
        </mml:mrow>
    </mml:mrow>
</mml:math>

stretchy=”false” の場合

sum演算子のサイズが前後の要素に合わせて調整されない.

<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">
    <mml:mrow>
        <mml:msub>
            <mml:mo stretchy="false">∑</mml:mo>
            <mml:mrow>
                <mml:mi>i</mml:mi>
            </mml:mrow>
        </mml:msub>
        <mml:mrow>
            <mml:mrow>
                <mml:msub>
                    <mml:mo stretchy="false">∑</mml:mo>
                    <mml:mrow>
                        <mml:mi>k</mml:mi>
                    </mml:mrow>
                </mml:msub>
                <mml:mrow>
                    <mml:mi>a</mml:mi>
                </mml:mrow>
            </mml:mrow>
        </mml:mrow>
    </mml:mrow>
</mml:math>

参考文献