MathML コア
MathML Core

W3C草案
W3C Working Draft

この文書についてのより詳細な情報
More details about this document
この文書のバージョン:
This version:
https://www.w3.org/TR/2023/WD-mathml-core-20231127/
最新公開バージョン:
Latest published version:
https://www.w3.org/TR/mathml-core/
最新の編集者草案:
Latest editor's draft:
https://w3c.github.io/mathml-core/
履歴:
History:
https://www.w3.org/standards/history/mathml-core/
Commit history
テストツール:
Test suite:
https://github.com/web-platform-tests/wpt/tree/master/mathml/
実装の報告書:
Implementation report:
https://wpt.fyi/results/?label=master&label=experimental&aligned&q=math%20%20not%28path%3A%2Fjs%29
編集者:
Editors:
David Carlisle (NAG(訳注:ニューメリカルアルゴリズムグループ))
David Carlisle (NAG)
Frédéric Wang (Igalia)
Frédéric Wang (Igalia)
以前の編集者:
Former editors:
Patrick Ion (アメリカ数学会 Mathematical Reviews(訳注:アメリカ数学会が発行している書誌情報データベース))
Patrick Ion (Mathematical Reviews, American Mathematical Society)
Robert Miner (故人) (Design Science社)
Robert Miner (deceased) (Design Science, Inc.)
意見:
Feedback:
GitHub w3c/mathml-core (pull requests, new issue, open issues)

概要
Abstract

この仕様書は, 数学用マークアップ言語またはMathMLの, ブラウザの実装に適した中核部分を定義しています. MathMLは, 数学表記を記述したり, その構造と意味の両方をうまく再現するマークアップ言語です. MathMLの目標は, HTMLが文章に対してできるようにしたように, 数学をワールド・ワイド・ウェブ上で提供したり, 受け取ったり, 処理したりできるようにすることです.

This specification defines a core subset of Mathematical Markup Language, or MathML, that is suitable for browser implementation. MathML is a markup language for describing mathematical notation and capturing both its structure and content. The goal of MathML is to enable mathematics to be served, received, and processed on the World Wide Web, just as HTML has enabled this functionality for text.

この文書の位置付け
Status of This Document

この節では, 公表された時点でのこの文書の位置付けについて述べます. 最新のW3Cの公表した文書の一覧やこの技術報告書の最新版は, W3C技術報告書の索引(http://www.w3.org/TR/)で見ることができます.

This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.

この文書は, 数学作業部会によって, 勧告工程に従って, 草案として発行されました.

This document was published by the Math Working Group as a Working Draft using the Recommendation track.

草案としての発行は, W3Cおよびその会員による支持を意味していません.

Publication as a Working Draft does not imply endorsement by W3C and its Members.

この文書は草案であり, いつでも他の文書によって更新されたり, 置き換えられたり, 破棄されたりしてもよいです. 作業の経過によらず, この文書を掲載することが不適当になります.

This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

この文書は, W3C特許指針の下で運営している作業部会によって作成されました. W3Cは, この作業部会の成果に関連して作成された特許開示の公開一覧を管理しています. この一覧のページは, 特許を開示する場合の指示書きを含んでいます. 特許について実際に生じている情報を持っている方は, その情報が本質的な主張(訳注:当該日本語訳では"Essential Claim"の日本語訳に"本質的な主張"を当てていますが, "Essential Claim"という用語はW3C特許指針で定義された用語です.)に当たると思われる場合, W3C特許指針の第6節に従って必ずその情報を開示して下さい.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

この文書は, 2023年11月3日版のW3C手続き文書により決定されました.

This document is governed by the 03 November 2023 W3C Process Document.

1. 導入
Introduction

この節は規範ではありません.

This section is non-normative.

[MATHML3]仕様書は, ウェブ描画プログラムを横断して一貫した実装を行うことや, 利用者が定義した構造と一緒に拡張することを困難にする様々な欠点を持っています. 例えば, 次のものです.

The [MATHML3] specification has several shortcomings that make it hard to implement consistently across web rendering engines or to extend with user-defined constructions, e.g.:

このMathMLコア仕様書は, TeXBookの付録[TEXBOOK]やOpen Font Format [OPEN-FONT-FORMAT]からの追加の決まりを用いることで, 数式の視覚的表現において可能な限り正確にすることで, これらの課題に取り組むつもりです. この仕様書は, ウェブプラットフォームの層を改良する新しいコンピュータ寄りの基本要素を必要としたり, 導入したりするときに, 最新のブラウザの実装やウェブ技術との相互作用を明確にする, 実装や技術[HTML][SVG] [CSS2] [DOM]に頼っています.

This MathML Core specification intends to address these issues by being as accurate as possible on the visual rendering of mathematical formulas using additional rules from the TeXBook’s Appendix G [TEXBOOK] and from the Open Font Format [OPEN-FONT-FORMAT], [OPEN-TYPE-MATH-ILLUMINATED]. It also relies on modern browser implementations and web technologies [HTML] [SVG] [CSS2] [DOM], clarifying interactions with them when needed or introducing new low-level primitives to improve the web platform layering.

この枠組みと上手く整合しない, またはあまり基本的でないMathML3の部分は, 省略されました. 代わりに, それらの部分は, 分割されたより大きな[MATHML4]仕様書で説明しています. どの数学機能が, MathMLコアの将来のバージョンに含まれたり, ポリフィルとして実装されたりするかについては, まだ可能性があります. この問題や潜在的な改良点は, GitHubで記録されます.

Parts of MathML3 that do not fit well in this framework or are less fundamental have been omitted. Instead, they are described in a separate and larger [MATHML4] specification. The details of which math feature will be included in future versions of MathML Core or implemented as polyfills is still open. This question and other potential improvements are tracked on GitHub.

細部の実装の水準を増やしたり, 動く部分に焦点を当てたり, ブラウザで動く設計に従ったり, ウェブプラットフォームの自動テストに頼ったりすることで, この仕様書は, MathMLの相互運用性を大いに改良することが期待されています. さらに, MathMLの層での努力は, shadow trees, カスタム要素, [HOUDINI]のAPIといった最新のウェブ技術を利用することで, 利用者に対し, MathML4の残りの部分を実装すること, または, より一般にMathMLコアを拡張することを可能にします.

By increasing the level of implementation details, focusing on a workable subset, following a browser-driven design and relying on automated web platform tests, this specification is expected to greatly improve MathML interoperability. Moreover, effort on MathML layering will enable users to implement the rest of the MathML 4 specification, or more generally to extend MathML Core, using modern web technologies such as shadow trees, custom elements or APIs from [HOUDINI].

2. MathMLの基礎
MathML Fundamentals

2.1 要素と属性
Elements and attributes

MathML要素という用語は, MathML名前空間にある何らかの要素を指しています. この仕様書で定義されているMathML要素は, MathMLコア要素と呼ばれ, 下記の一覧のとおりです. 下記の一覧に無い何らかのMathML要素は, MathML未知要素と呼ばれます.

The term MathML element refers to any element in the MathML namespace. The MathML elements defined in this specification are called the MathML Core elements and are listed below. Any MathML element that is not listed below is called an Unknown MathML element.

  1. annotation
  2. annotation-xml
  3. maction
  4. math
  5. merror
  6. mfrac
  7. mi
  8. mmultiscripts
  9. mn
  10. mo
  11. mover
  12. mpadded
  13. mphantom
  14. mprescripts
  15. mroot
  16. mrow
  17. ms
  18. mspace
  19. msqrt
  20. mstyle
  21. msub
  22. msubsup
  23. msup
  24. mtable
  25. mtd
  26. mtext
  27. mtr
  28. munder
  29. munderover
  30. semantics

グループ要素は, maction, math, merror, mphantom, mprescripts, mrow, mstyle, semantics, MathML未知要素です.

The grouping elements are maction, math, merror, mphantom, mprescripts, mrow, mstyle, semantics and unknown MathML elements.

添え字要素は, mmultiscripts, mover, msub, msubsup, msup, munder, munderoverです.

The scripted elements are mmultiscripts, mover, msub, msubsup, msup, munder and munderover.

根号要素は, mrootmsqrtです.

The radical elements are mroot and msqrt.

この仕様書で定義された属性は, 何も名前空間を持たず, MathML属性と呼ばれます.

The attributes defined in this specification have no namespace and are called MathML attributes:

2.1.1 一番上の<math>要素
The Top-Level <math> Element

MathMLは, 唯一の一番上のルート要素であるmath要素を指定しています. math要素は, 文書の中のMathMLマークアップの各要素を包み込みます. 全ての他のMathMLの内容は, <math>要素の中に含まれなければなりません.

MathML specifies a single top-level or root math element, which encapsulates each instance of MathML markup within a document. All other MathML content must be contained in a <math> element.

<math>要素は, 2.1.3 共通の属性で説明する属性と, 次の属性を持ちます.

The <math> element accepts the attributes described in 2.1.3 Global Attributes as well as the following attributes:

display属性が, もし存在するなら, blockまたはinline大文字・小文字を区別せずに一致しなければなりません. A. ユーザーエージェントのスタイルシートで述べられているユーザーエージェント(訳注:利用者のOSやブラウザ)のスタイルシートは, displayプロパティ(block mathまたはinline math)やmath-styleプロパティ(normalまたはcompact)の既定値に影響する, この属性に対する決まりを含みます. display属性が無かったり, 無効な値を持っていたりする場合, ユーザーエージェントのスタイルシートは, その属性値をinlineと同じとして扱います.

The display attribute, if present, must be an ASCII case-insensitive match to block or inline. The user agent stylesheet described in A. User Agent Stylesheet contains rules for this attribute that affect the default values for the display (block math or inline math) and math-style (normal or compact) properties. If the display attribute is absent or has an invalid value, the User Agent stylesheet treats it the same as inline.

この仕様書は, alttext属性に指定する何ら注目すべき挙動を定義していません.

This specification does not define any observable behavior that is specific to the alttext attribute.

注意
Note
alttext属性は, 数式表示を実装していない古いソフトウェアで, 代替の文章として使用されてもよいです.
The alttext attribute may be used as alternative text by some legacy systems that do not implement math layout.

要素が, block mathまたはinline mathと等しいdisplayプロパティの算出値を持たない場合, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. もしくは, mrow要素の配置アルゴリズムが, 数学コンテンツボックスを生み出すのに利用されます. 数学コンテンツボックスは, CSSで, display: block(算出値がblock mathの場合)またはdisplay: inline (算出値がinline mathの場合)に対して述べられているように, 要素の配置のための内容ボックスとして利用されます. 加えて, displayプロパティの算出値がblock mathに等しいなら, 数学コンテンツボックスは, 全体のボックス領域の水平方向の中心に描画されます.

If the <math> element does not have its computed display property equal to block math or inline math then it is laid out according to the CSS specification where the corresponding value is described. Otherwise the layout algorithm of the mrow element is used to produce a math content box. That math content box is used as the content for the layout of the element, as described by CSS for display: block (if the computed value is block math) or display: inline (if the computed value is inline math). Additionally, if the computed display property is equal to block math then that math content box is rendered horizontally centered within the content box.

注意
Note
TEXのディスプレイモード$$...$$とインラインモード$...$は, それぞれdisplay="block"display="inline"に相当します.
TEX's display mode $$...$$ and inline mode $...$ correspond to display="block" and display="inline" respectively.

次の例において, 数式mathは, 改行され, 全体の幅を使って, 数式の内容をその領域の中心に寄せるディスプレイモードで描画されます.

In the following example, a math formula is rendered in display mode on a new line and taking full width, with the math content centered within the container:

<div style="width: 15em;">
  This mathematical formula with a big summation and the number pi
  (訳注:"大きな総和記号と数字パイを用いたこの数式"の意味)
  <math display="block" style="border: 1px dotted black;">
    <mrow>
      <munderover>
        <mo></mo>
        <mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow>
        <mrow><mo>+</mo><mn></mn></mrow>
      </munderover>
      <mfrac>
        <mn>1</mn>
        <msup><mi>n</mi><mn>2</mn></msup>
      </mfrac>
    </mrow>
    <mo>=</mo>
    <mfrac>
      <msup><mi>π</mi><mn>2</mn></msup>
      <mn>6</mn>
    </mfrac>
  </math>
  is easy to prove.
  (訳注:"証明するのが容易です."の意味)
</div>
math example (display)

これと比較して, 同じ式がインラインモードでは次のように見えるでしょう. その式は, 強制的な改行無しに, 文章の段落の中に埋め込まれます. mrowの配置アルゴリズムによって指定される基準線は, 鉛直方向の位置揃えに利用されます. 総和と等号記号の中心, また分数は, 全て揃えられますが, 周りを囲っている文章の欧文ベースラインとは揃わないことに注意して下さい.

As a comparison, the same formula would look as follows in inline mode. The formula is embedded in the paragraph of text without forced line breaking. The baselines specified by the layout algorithm of the mrow are used for vertical alignment. Note that the middle of sum and equal symbols or fractions are all aligned, but not with the alphabetical baseline of the surrounding text.

math example (inline)

良質な数学の描画には数学用フォントの利用が必要なことから, ユーザーエージェントのスタイルシートは,font-familyを継承するのではなく, <math>要素でfont-familymathの値に設定すべきです. 加えて, font-style, font-weight, direction, text-indentなどといった親要素で設定できる様々なCSSプロパティは, 数式に適用されないことが期待され, そのため, ユーザーエージェントのスタイルシートは, 通常, それらの値を再設定する決まりを持ちます.

Because good mathematical rendering requires use of mathematical fonts, the user agent stylesheet should set the font-family to the math value on the <math> element instead of inheriting it. Additionally, several CSS properties that can be set on a parent container such as font-style, font-weight, direction or text-indent etc are not expected to apply to the math formula and so the user agent stylesheet has rules to reset them by default.

math {
  direction: ltr;
  text-indent: 0;
  letter-spacing: normal;
  line-height: normal;
  word-spacing: normal;
  font-family: math;
  font-size: inherit;
  font-style: normal;
  font-weight: normal;
  display: inline math;
  math-shift: normal;
  math-style: compact;
  math-depth: 0;
}
math[display="block" i] {
  display: block math;
  math-style: normal;
}
math[display="inline" i] {
  display: inline math;
  math-style: compact;
}

2.1.2 MathML属性の値に対する型
Types for MathML Attribute Values

CSSデータ型に加えて, MathML属性の中には, 次に示すMathML特有の型を持つものもあります.

In addition to CSS data types, some MathML attributes rely on the following MathML-specific types:

符号無し整数
unsigned-integer
[CSS-VALUES-4]で定義された<integer>の値, その最初の文字は, U+002Dハイフンマイナス文字(-)またはU+002Bプラス記号(+)のどちらでもありません.
An <integer> value as defined in [CSS-VALUES-4], whose first character is neither U+002D HYPHEN-MINUS character (-) nor U+002B PLUS SIGN (+).
ブール値
boolean
trueまたはfalse大文字・小文字を区別せずに一致する文字列.
A string that is an ASCII case-insensitive match to true or false.

2.1.3 共通の属性
Global Attributes

次の属性は, 全てのMathML要素に共通で, 全ての要素において指定されてもよいです.

The following attributes are common to and may be specified on all MathML elements:

2.1.4 HTML要素とMathML要素に共通する属性
Attributes common to HTML and MathML elements

id属性, class属性, style属性, data-*属性, nonce属性, tabindex属性は, HTML要素の id属性, class属性, style属性, data-*属性, nonce属性, tabindex属性で定義されたものと同じ構文や意味を持ちます.

The id, class, style, data-*, nonce and tabindex attributes have the same syntax and semantics as defined for id, class, style, data-*, nonce and tabindex attributes on HTML elements.

dir属性が, もし存在するなら, ltrまたはrtl大文字・小文字を区別せずに一致しなければなりません. その場合, ユーザーエージェントは, その属性値に対応する値に要素のdirectionプロパティを設定する表現の助言として, その属性を取り扱うことが期待されます. より正確には, 大文字・小文字を区別せずにrtlに一致するものはrtlに変換され, 一方, 大文字・小文字を区別せずにltrに一致するものはltrに変換されます.

The dir attribute, if present, must be an ASCII case-insensitive match to ltr or rtl. In that case, the user agent is expected to treat the attribute as a presentational hint setting the element's direction property to the corresponding value. More precisely, an ASCII case-insensitive match to rtl is mapped to rtl while an ASCII case-insensitive match to ltr is mapped to ltr.

注意
Note
dir属性は, アラビア語圏でよくrtlとされる数式の方向を設定するのに利用されます. しかしながら, 右から左へ書かれる言語は, 左から右へ書かれる数学をよく埋め込むことから, ユーザーエージェントのスタイルシートは, math要素のdirectionプロパティを状況に応じて再設定します.
The dir attribute is used to set the directionality of math formulas, which is often rtl in Arabic speaking world. However, languages written from right to left often embed math written from left to right and so the user agent stylesheet resets the direction property accordingly on the math elements.

次の例において, dir属性は, "𞸎足す𞸑の(𞸟足す١分の٢)乗"を右から左へ描画するのに利用されています.

In the following example, the dir attribute is used to render "𞸎 plus 𞸑 raised to the power of (٢ over, 𞸟 plus ١)" from right-to-left.

<math dir="rtl">
  <mrow>
    <mi>𞸎</mi>
    <mo>+</mo>
    <msup>
      <mi>𞸑</mi>
      <mfrac>
        <mn>٢</mn>
        <mrow>
          <mi>𞸟</mi>
          <mo>+</mo>
          <mn>١</mn>
        </mrow>
      </mfrac>
    </msup>
  </mrow>
</math>
dir example

全てのMathML要素は, HTMLにおいてイベントハンドラーコンテンツ属性で述べられているように, イベントハンドラーコンテンツ属性に対応しています.

All MathML elements support event handler content attributes, as described in event handler content attributes in HTML.

全てのHTML要素によって対応されているものとしてHTMLによって示されている全てのイベントハンドラーコンテンツ属性は, MathML要素IDLで定義されているように, 全てのMathML要素によっても対応されています.

All event handler content attributes noted by HTML as being supported by all HTMLElements are supported by all MathML elements as well, as defined in the MathMLElement IDL.

2.1.5 従来のMathML書式属性
Legacy MathML Style Attributes

mathcolor属性とmathbackground属性は, もし存在するなら, <color>である値を持たねければなりません. その場合, ユーザーエージェントは, それらの属性値に対応する値に要素のcolorプロパティやbackground-colorプロパティを設定する表現の助言として, それらの属性を取り扱うことが期待されます. mathcolor属性は, MathMLの文字列, 線などの前景の塗り潰しの色について述べ, 一方, mathbackground属性は, 要素の背景の色について述べます.

The mathcolor and mathbackground attributes, if present, must have a value that is a <color>. In that case, the user agent is expected to treat these attributes as a presentational hint setting the element's color and background-color properties to the corresponding values. The mathcolor attribute describes the foreground fill color of MathML text, bars etc while the mathbackground attribute describes the background color of an element.

mathsize属性は, もし存在するなら, 有効な<length-percentage>(訳注:長さや百分率)である値を持たねければなりません. その場合, ユーザーエージェントは, その属性値に対応する値に要素のfont-sizeプロパティを設定する表現の助言として, その属性を取り扱うことが期待されます. mathsizeプロパティは, 数式における字形の要求された高さを意図しますが, それに応じて他の部分(空白, 字下げ, 線の太さなど)の寸法も変更します.

The mathsize attribute, if present, must have a value that is a valid <length-percentage>. In that case, the user agent is expected to treat the attribute as a presentational hint setting the element's font-size property to the corresponding value. The mathsize property indicates the desired height of glyphs in math formulas but also scales other parts (spacing, shifts, line thickness of bars etc) accordingly.

注意
Note
上記の属性は, 完全なMathMLとの互換性のための実装です. MathMLコアのみを対象とする著者は, 書式にCSSを利用することが推奨されます.
The above attributes are implemented for compatibility with full MathML. Authors whose only target is MathML Core are encouraged to use CSS for styling.

2.1.6 displaystyle属性とscriptlevel属性
The displaystyle and scriptlevel attributes

displaystyle属性は, もし存在するなら, ブール値である値を持たなければなりません. その場合, ユーザーエージェントは, その属性値に対応する値に要素のmath-styleプロパティを設定する表現の助言として, その属性を取り扱うことが期待されます. より正確には, 大文字・小文字を区別せずにtrueに一致するものはnormalに変換され, 一方, 大文字・小文字を区別せずにfalseに一致するものはcompactに変換されます. この属性は, 例えば, 式の数学コンテンツの大きさや添え字の配置を変更することで, 式が論理的な高さを最小化するように試みるべきか(値がfalse), そうでないか(値がtrue)を示します.

The displaystyle attribute, if present, must have a value that is a boolean. In that case, the user agent is expected to treat the attribute as a presentational hint setting the element's math-style property to the corresponding value. More precisely, an ASCII case-insensitive match to true is mapped to normal while an ASCII case-insensitive match to false is mapped to compact. This attribute indicates whether formulas should try to minimize the logical height (value is false) or not (value is true) e.g. by changing the size of content or the layout of scripts.

scriptlevel属性は, もし存在するなら, <U>符号無し整数だとして, 値+<U>, -<U>, <U>を持たなければなりません. その場合, ユーザーエージェントは, その属性値に対応する値に要素のmath-depthプロパティを設定する表現の助言として, scriptlevelを取り扱うことが期待されます. より正確には, +<U>, -<U>, <U>は, それぞれadd(<U>), add(<-U>), <U>に変換されます.

The scriptlevel attribute, if present, must have value +<U>, -<U> or <U> where <U> is an unsigned-integer. In that case the user agent is expected to treat the scriptlevel attribute as a presentational hint setting the element's math-depth property to the corresponding value. More precisely, +<U>, -<U> and <U> are respectively mapped to add(<U>) add(<-U>) and <U>.

displaystylescriptlevelの値は, MathML要素の中で自動的に調整されます. これらの属性を完全に実装するには, 追加のCSSプロパティが, A. ユーザーエージェントのスタイルシートで述べられているように, ユーザーエージェントのスタイルシートで指定されなければなりません. 特に, 全てのMathML要素に対して, 既定値font-size: mathは, scriptlevelの変更が計算の中で行われることを確実にするために指定されます.

displaystyle and scriptlevel values are automatically adjusted within MathML elements. To fully implement these attributes, additional CSS properties must be specified in the user agent stylesheet as described in A. User Agent Stylesheet. In particular, for all MathML elements a default font-size: math is specified to ensure that scriptlevel changes are taken into account.

この例において, munder要素は, 添え字"A"を基となる部分"∑"にくっつけるのに利用されています. 通常, 総和記号は, 親要素から継承されたフォントサイズで, 下付き添え字に縮められたAと一緒に描画されます. displaystyleがtrueの場合, 総和記号はより大きく描かれ, "A" は下側の添え字になります. "A"のscriptlevelを0に再設定した場合, "A"は, 1番上のmathルート要素と同じフォントサイズを利用するでしょう.

In this example, an munder element is used to attach a script "A" to a base "∑". By default, the summation symbol is rendered with the font-size inherited from its parent and the A as a scaled down subscript. If displaystyle is true, the summation symbol is drawn bigger and the "A" becomes an underscript. If scriptlevel is reset to 0 on the "A", then it will use the same font-size as the top-level math root.

<math>
  <munder>
    <mo></mo>
    <mi>A</mi>
  </munder>
  <munder displaystyle="true">
    <mo></mo>
    <mi>A</mi>
  </munder>
  <munder>
    <mo></mo>
    <mi scriptlevel="0">A</mi>
  </munder>
</math>
displaystyle-scriptlevel example
注意
Note
TEXの\displaystyle, \textstyle, \scriptstyle, \scriptscriptstyleは, それぞれdisplaystylescriptlevelの組合せtrue0, false0, false1, falseと2に相当します.
TEX's \displaystyle, \textstyle, \scriptstyle, and \scriptscriptstyle correspond to displaystyle and scriptlevel as true and 0, false and 0, false and 1, and false and 2, respectively.

2.1.7 有効性のために予約された属性
Attributes Reserved as Valid

属性intentと属性argは, 有効性のために予約されています.

The attributes intent and arg are reserved as valid attributes.

この仕様書は, intent属性とarg属性に指定する何ら注目すべき挙動を定義していません.

This specification does not define any observable behavior that is specific to the intent and arg attributes.

注意
Note
これらの属性は[MATHML4]で説明されており, この仕様書の将来版で定義されても, 定義されなくてもよいです. 著者は, これらが現在開発中で変更を前提としていることを知っているべきです.
These attributes are described in [MATHML4] and future versions of this specification may or may not define them. Authors should be aware that they are currently in development and subject to change.

2.2 ウェブプラットフォームにおける統合
Integration in the Web Platform

2.2.1 HTMLとSVG
HTML and SVG

MathMLを, 関連する仕様書[HTML] [SVG]で述べられているように, HTMLやSVGと混在することができます.

MathML can be mixed with HTML and SVG as described in the relevant specifications [HTML] [SVG].

SVGのrequiredExtensions属性の値を求めるとき, ユーザーエージェントは, MathML名前空間によって特定された言語拡張に対する対応を要求しなければなりません.

When evaluating the SVG requiredExtensions attribute, user agents must claim support for the language extension identified by the MathML namespace.

この例において, 行の中のMathMLとSVGが, HTML文書の中で利用されています. SVG要素<switch>と(適切な<requiredExtensions>と一緒の)SVG要素<foreignObject>は, 予備の文字列と一緒に, MathMLの式を図の中に埋め込むために利用されます. HTMLのinputは, 数式の中に相互作用する入力部分を含むためにmtextの中で利用されます. annotation-xml要素の中でのSVGやHTMLの例については, 3.7 意味と表現も参照して下さい.

In this example, inline MathML and SVG elements are used inside an HTML document. SVG elements <switch> and <foreignObject> (with proper <requiredExtensions>) are used to embed a MathML formula with a text fallback, inside a diagram. HTML input element is used within the mtext to include an interactive input field inside a mathematical formula. See also 3.7 Semantics and Presentation for an example of SVG and HTML inside an annotation-xml element.

<svg style="font-size: 20px" width="400px" height="220px" viewBox="0 0 200 110">
  <g transform="translate(10,80)">
    <path d="M 0 0 L 150 0 A 75 75 0 0 0 0 0
             M 30 0 L 30 -60 M 30 -10 L 40 -10 L 40 0"
          fill="none" stroke="black"></path>
    <text transform="translate(10,20)">1</text>
    <switch transform="translate(35,-40)">
      <foreignObject width="200" height="50"
                     requiredExtensions="http://www.w3.org/1998/Math/MathML">
        <math>
          <msqrt>
            <mn>2</mn>
            <mi>r</mi>
            <mo></mo>
            <mn>1</mn>
          </msqrt>
        </math>
      </foreignObject>
      <text>\sqrt{2r - 1}</text>
    </switch>
  </g>
</svg>

<p>
  Fill the blank:
  (訳注:"空欄を埋めて下さい."の意味)
  <math>
    <msqrt>
      <mn>2</mn>
      <mtext><input onchange="..." size="2" type="text"></mtext>
      <mo></mo>
      <mn>1</mn>
    </msqrt>
    <mo>=</mo>
    <mn>3</mn>
  </math>
</p>
html-svg example

2.2.2 CSS書式
CSS styling

ユーザーエージェントは, 4. 数学配置のためのCSS拡張で述べられている新しい機能を含め, この仕様書で述べられている様々なCSS機能に対応しなければなりません. それらの機能は, display: contentsに対する計算の決まりに従わなければなりません.

User agents must support various CSS features mentioned in this specification, including new ones described in 4. CSS Extensions for Math Layout. They must follow the computation rule for display: contents.

この例において, MathMLの式は, 親要素のCSSの色を継承し, style属性を通じて指定されたfont-familyを利用します.

In this example, the MathML formula inherits the CSS color of its parent and uses the font-family specified via the style attribute.

<div style="width: 15em; color: blue">
  This mathematical formula with a big summation and the number pi
  (訳注:"大きな総和記号と数字パイを用いたこの数式"の意味)
  <math display="block" style="font-family: STIX Two Math">
    <mrow>
      <munderover>
        <mo></mo>
        <mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow>
        <mrow><mo>+</mo><mn></mn></mrow>
      </munderover>
      <mfrac>
        <mn>1</mn>
        <msup><mi>n</mi><mn>2</mn></msup>
      </mfrac>
    </mrow>
    <mo>=</mo>
    <mfrac>
      <msup><mi>π</mi><mn>2</mn></msup>
      <mn>6</mn>
    </mfrac>
  </math>
  is easy to prove.
  (訳注:"証明するのが容易です."の意味)
</div>
style example

MathMLコア要素を含む全ての文書は, ユーザーエージェントの水準でのスタイルシートの既定値として, A. ユーザーエージェントのスタイルシートで述べられているCSSの決まりを含まなければなりません. 特に, これらの文書は, 全てのMatHML要素において書字モードhorizontal-lrに強制するために!important規則を加えます.

All documents containing MathML Core elements must include CSS rules described in A. User Agent Stylesheet as part of user-agent level style sheet defaults. In particular, this adds !important rules to force writing mode to horizontal-lr on all MathML elements.

floatプロパティは, 親要素のdisplayの算出値がblock mathまたはinline mathの要素を回り込ませんし, それらの要素をフロー外にしません.

The float property does not create floating of elements whose parent's computed display value is block math or inline math, and does not take them out-of-flow.

::first-line疑似要素や::first-letter疑似要素は, displayの算出値がblock mathまたはinline mathの要素に適用されず, それらの要素は祖先要素の最初の行や最初の文字に影響を与えません.

The ::first-line and ::first-letter pseudo-elements do not apply to elements whose computed display value is block math or inline math, and such elements do not contribute a first formatted line or first letter to their ancestors.

次のCSSの機能は, 対応されておらず, 無視されなければなりません.

The following CSS features are not supported and must be ignored:

  • 数式の中での改行:全てのMathML要素において, white-spacenowrapとして取り扱われます.
    Line breaking inside math formulas: white-space is treated as nowrap on all MathML elements.
  • 位置揃え:全てのMathML要素において, align-content, justify-content, align-self, justify-selfは何ら効果を持ちません.
    Alignment properties: align-content, justify-content, align-self, justify-self have no effects on MathML elements.
注意
Note
これらの機能は, この仕様書の将来のバージョンで処理されるかもしれません. 今のところは, 著者は, 下位互換性の課題を引き起こすかもしれないことから, これらのプロパティを異なった値に設定することを避けるべきです.
These features might be handled in future versions of this document. For now, authors are discouraged from setting a different value for these properties as that might lead to backward incompatibility issues.

2.2.3 DOMとJavaScript
DOM and JavaScript

ウェブアプリケーションAPIに対応したユーザーエージェントは, [DOM]木構造と同期したMathMLの視覚的描画を維持することを確実にしなければなりません. 特にMathML属性を動的に修正する際に, 必要な更新を行わなければなりません.

User agents supporting Web application APIs must ensure that they keep the visual rendering of MathML synchronized with the [DOM] tree, in particular perform necessary updates when MathML attributes are modified dynamically.

DOMでMathML要素を表現する全てのノードは, 次に示すMathMLElementインターフェイスを実装し, スクリプトに触れさせなければなりません.

All the nodes representing MathML elements in the DOM must implement, and expose to scripts, the following MathMLElement interface.

WebIDL[Exposed=Window]
interface MathMLElement : Element { };
MathMLElement includes GlobalEventHandlers;
MathMLElement includes HTMLOrForeignElement;

GlobalEventHandlersインターフェイス, HTMLOrForeignElementインターフェイスは, [HTML]で定義されています.

The GlobalEventHandlers and HTMLOrForeignElement interfaces are defined in [HTML].

次の例において, MathMLの式は, 分数"2分のα"を描画するのに使われています. 赤いαをクリックすると, 青いβに変わります.

In the following example, a MathML formula is used to render the fraction "α over 2". When clicking the red α, it is changed into a blue β.

<script>
  function ModifyMath(mi) {
      mi.style.color = 'blue';
      mi.textContent = 'β';
  }
</script>
<math>
  <mrow>
    <mfrac>
      <mi style="color: red" onclick="ModifyMath(this)">α</mi>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>
dom-idl example
課題
Issue
HTMLOrSVGElementの名前を変更し, [HTML]でのMathMLElementを定義する必要があります.
Rename HTMLOrSVGElement and define MathMLElement in [HTML].

2.2.4 文字配置
Text layout

数学用フォントは一般に大きな積分記号といったとても高さのある字形を含むことから, 植字の尺度を用いることは, 文章の過度の行間を避けるために重要です. 結果として, ユーザーエージェントは, 文字配置を成し遂げる際に, OS/2テーブル[OPEN-FONT-FORMAT] のUSE_TYPO_METRICSフラグに注意しなければなりません.

Because math fonts generally contain very tall glyphs such as big integrals, using typographic metrics is important to avoid excessive line spacing of text. As a consequence, user agents must take into account the USE_TYPO_METRICS flag from the OS/2 table [OPEN-FONT-FORMAT] when performing text layout.

2.2.5 フォーカス
Focus

MathMLでは, HTMLで述べれているFocus(訳注:"フォーカス"の意味)と同じ概念, 接続要求, 案内を用いて, この節で述べられているMathMLへの適用に関する変更または明確化によって, 相互作用するユーザーエージェントに対応することで, 著者に相互作用を認める機能を提供します.

MathML provides the ability for authors to allow for interactivity in supporting interactive user agents using the same concepts, approach and guidance to Focus as described in HTML, with modifications or clarifications regarding application for MathML as described in this section.

要素がフォーカスされたとき, セレクタ Level 3で述べられている全ての適用可能なCSSのフォーカスに関係ある擬似クラスが, この仕様書で定義されたように適用されます.

When an element is focused, all applicable CSS focus-related pseudo-classes as defined in Selectors Level 3 apply, as defined in that specification.

(素子要素の中のHTML要素を含め)埋め込まれたmath要素の中身は, それらを含む親となるHTML文書の(逐次的なフォーカスの順番を組合せた)逐次的なフォーカスの順番の一因となります.

The contents of embedded math elements (including HTML elements inside token elements) contribute to the sequential focus order of the containing owner HTML document (combined sequential focus order).

3. プレゼンテーションマークアップ
Presentation Markup

3.1 視覚的書式モデル
Visual formatting model

3.1.1 ボックスモデル
Box Model

displayプロパティの既定値は, A. ユーザーエージェントのスタイルシートで述べられています.

The default display property is described in A. User Agent Stylesheet:

  • <math>ルート要素に対して, 既定値は, display属性の値に応じて, inline mathまたはblock mathに等しくなります.
    For the <math> root, it is equal to inline math or block math according to the value of the display attribute.
  • 表のMathML要素 mtable, mtr, mtdに対して, 既定値は, それぞれinline-table, table-row, table-cellに等しくなります.
    For Tabular MathML elements mtable, mtr, mtd it is respectively equal to inline-table, table-row and table-cell.
  • 最初の子要素を除く全てのmaction要素とsemantics要素に対して, 既定値は, noneに等しくなります.
    For all but the first children of the maction and semantics elements, it is equal to none.
  • その他の全てのMathML要素に対して, 既定値は, block mathに等しくなります.
    For all the other MathML elements it is equal to block math.

異なる書字モードにおける数学配置を指定するために, この仕様書は, [CSS-WRITING-MODES-4]による概念を利用します.

In order to specify math layout in different writing modes, this specification uses concepts from [CSS-WRITING-MODES-4]:

注意
Note
他に指定がない限り, この仕様書の図は, horizontal-lrltr書字モードを利用します. 数学配置でときどき利用される他の書字モードの例については, 4, 5, 6を参照して下さい.
Unless specified otherwise, the figures in this specification use a writing mode of horizontal-lr and ltr. See Figure 4, Figure 5 and Figure 6 for examples of other writing modes that are sometimes used for math layout.

MathML要素で使われるボックスは, CSSと互換性のある方法で配置を成し遂げるための, ただし, 数式の中でのとても精密な位置や間隔も考慮に入れた様々なパラメータを当てにしています. 数学の各ボックスは, 次のパラメータを持ちます.

Boxes used for MathML elements rely on several parameters in order to perform layout in a way that is compatible with CSS but also to take into account very accurate positions and spacing within math formulas:

  1. 行内の尺度. CSSに基づく最小内容行内サイズ, 最大内容行内サイズ, 行内サイズ. 1を参照して下さい.
    1 MathML要素に対する一般的なボックスモデル
    Figure 1 Generic Box Model for MathML elements
  2. ブロックの尺度. ブロックサイズ, 最初の基準線集合, 最後の基準線集合. 次の基準線がMathMLのボックスのために定義されています.

    Block metrics. The block size, first baseline set and last baseline set. The following baselines are defined for MathML boxes:

    1. 典型的に大文字のラテン文字の字形の下端を揃える欧文ベースライン. ボックスの欧文ベースラインから行上面の境界までの代数的な距離は, 行アセントと呼ばれます. ボックスの行下面の境界から欧文ベースラインまでの代数的な距離は, 行ディセントと呼ばれます(訳注:日本語では"ディセンダ"と呼ばれることもありますが, 原文の表現に合わせて欧文ベースラインから下の部分を"ディセンダ", その距離を"ディセント"と呼んでいます).
      The alphabetic baseline which typically aligns with the bottom of uppercase Latin glyphs. The algebraic distance from the alphabetic baseline to the line-over edge of the box is called the line-ascent. The algebraic distance from the line-under edge to the alphabetic baseline of the box is called the line-descent.
    2. 典型的に分数の線, かっこの真ん中, 二項演算子を揃える数学軸とも呼ばれる数学基準線. この基準線は, いつでも欧文ベースラインから行上面軸高さだけずれています.
      The mathematical baseline, also called math axis, which typically aligns with the fraction bar, middle of fences and binary operators. It is shifted away from the alphabetic baseline by AxisHeight towards the line-over.
    3. 余計な空間を除外した, 描かれる数学コンテンツの理論上の行上面の限界を意図する字面上面基準線(訳注:"字面"は本来和文フォントに対する概念ですが, 他に適当なものがないので"ink"の日本語訳に"字面"を当てました). 指定されていなければ, 行上面の境界に揃えられます. 欧文ベースラインから字面上面基準線までの代数的な距離は, 字面行アセントと呼ばれます.
      The ink-over baseline, indicating the line-over theorical limit of the math content drawn, excluding any extra space. If not specified, it is aligned with the line-over edge. The algebraic distance from the alphabetic baseline to the ink-over baseline is called the ink line-ascent.
    4. 余計な空間を除外した, 描かれる数学コンテンツの理論上の行下面の限界を意図する字面下面基準線. 指定されていなければ, 行下面の境界に揃えられます. 字面下面基準線から欧文ベースラインまでの代数的な距離は, 字面行ディセントと呼ばれます.
      The ink-under baseline, indicating the line-under theorical limit of the math content drawn, excluding any extra space. If not specified, it is aligned with the line-under edge. The algebraic distance from the ink-under baseline to the alphabetic baseline is called the ink line-descent.
    注意
    Note
    数学配置において, 文字列の位置を決める際に, 字面の範囲を当てにすることはとても重要です。このことは, より複雑な表記(例えば, 平方根)には該当しません. 字面アセントと字面ディセントは全てのMathML要素に対して定義されているにも関わらず, それらは, 実際のところ素子要素に対してのみ使用されます. それ以外の場合, それらは通常のアセントとディセントに単に一致します.
    For math layout, it is very important to rely on the ink extent when positioning text. This is not the case for more complex notations (e.g. square root). Although ink-ascent and ink-descent are defined for all MathML elements they are really only used for the token elements. In other cases, they just match normal ascent and descent.
    他で指定されていない限り, 最後の基準線集合は, MathMLボックスに対する最初の基準線集合に等しいです.
    Unless specified otherwise, the last baseline set is equal to the first baseline set for MathML boxes.
  3. ボックスの文字列が行内軸に対してどのくらい傾いているかを測る尺度を提供する, 任意のイタリック補正. 2を参照して下さい.
    An optional italic correction which provides a measure of how much the text of a box is slanted along the inline axis. See Figure 2.
    2 イタリック体のfと大きな積分記号に対するイタリック補正の例
    Figure 2 Examples of italic correction for italic f and large integral
    最小内容行内サイズ最大内容行内サイズを計算する途中で, もしくは配置する途中でイタリック補正を要求された場合, 0が予備の値として使用されます.
    If it is requested during calculation of min-content inline size and max-content inline size or during layout then 0 is used as a fallback value.
  4. アクセントとして, ボックスの位置を決める際に利用されるべき, ボックスの行内軸からずらす基準を提供する任意の上側アクセント付随位置. 3を参照して下さい.
    An optional top accent attachment which provides a reference offset on the inline axis of a box that should be used when positioning that box as an accent. See Figure 3.
    3 サーカムフレックスアクセントに対する上側アクセント付随位置の例
    Figure 3 Example of top accent attachment for a circumflex accent
    最小内容行内サイズ(または最大内容行内サイズ)を計算する中で, 上側アクセント付随位置を要求された場合, 最小内容行内サイズ(または最大内容行内サイズ)の半分が予備の値として使用されます. 配置の途中で要求された場合, ボックスの行内サイズの半分の値が予備の値として使用されます.
    If it is requested during calculation of min-content inline size (respectively max-content inline size) then half the min-content inline size (respectively max-content inline size) is used as a fallback value. If it is requested during layout then half the inline size of the box is used as a fallback value.

MathMLボックスが与えられたとき, 次の移動距離が定義されます.

Given a MathML box, the following offsets are defined:

  • 子要素ボックスの行内移動距離は, 親要素ボックスの行内始端と子要素ボックスの行内始端の間の距離です.
    The inline offset of a child box is the offset between the inline-start edge of the parent box and the inline-start edge of the child box.
  • 子要素ボックスのブロック移動距離は, 親要素ボックスのブロック始端と子要素ボックスのブロック始端の間の距離です.
    The block offset of a child box is the offset between the block-start edge of the parent box and the block-start edge of the child box.
  • 子要素ボックスの行左端移動距離は, 親要素ボックスの行左端と子要素ボックスの行左端の間の距離です.
    The line-left offset of a child box is the offset between the line-left edge of the parent box and the line-left edge of the child box.
4 例えばアラビア語の数学で使われてもよい書字モードhorizontal-tbおよびrtlに対するボックスモデル.
Figure 4 Box model for writing mode horizontal-tb and rtl that may be used in e.g. Arabic math.
5 例えばモンゴル語の数学で使われてもよい書字モードvertical-lrおよびltrに対するボックスモデル.
Figure 5 Box model for writing mode vertical-lr and ltr that may be used in e.g. Mongolian math.
6 例えば日本語の数学で使われてもよい書字モードvertical-rlおよびltrに対するボックスモデル.
Figure 6 Box model for writing mode vertical-rl and ltr that may be used in e.g. Japanese math.
注意
Note
MathML要素の中の, 子要素ボックスや描画される部品の場所は, 行内移動距離ブロック移動距離を用いて表されます. 便利なように, 配置アルゴリズムは, フローに関係した方向, または行に関係した方向, もしくは欧文ベースラインを用いて, 移動距離を説明してもよいです. 子要素ボックスの位置は, いつでも親要素ボックスや子要素ボックスの尺度を計算した後に決められるので, ある1つのものから, 他のものの描画へ移り変わることが可能です.
The position of child boxes and graphical items inside a MathML box are expressed using the inline offset and block offset. For convenience, the layout algorithms may describe offsets using flow-relative directions, line-relative directions or the alphabetic baseline. It is always possible to pass from one description to the other because position of child boxes is always performed after the metrics of the box and of its child boxes are calculated.

行に関係する尺度から得られる移動距離の例を示します.

Here are examples of offsets obtained from line-relative metrics:

課題78: 字面アセント/ディセント opentype/texneeds-tests
Issue 78: Ink ascent/descent
字面アセント/ディセントの定義を改良しますか?
Improve definition of ink ascent/descent?

3.1.2 配置アルゴリズム
Layout Algorithms

各MathML要素は関連する数学コンテンツボックスを持ちます. そのボックスは, 次の情報を用いるこの章の配置アルゴリズムのとおりに計算されます.

Each MathML element has an associated math content box, which is calculated as described in this chapter's layout algorithms using the following structure:

  1. 数学コンテンツの最小内容行内サイズ最大内容行内サイズの計算.
    Calculation of min-content inline size and max-content inline size of the math content.
  2. ボックスの配置:
    Box layout:
    1. フロー内の子要素ボックスの配置.
      Layout of in-flow child boxes.
    2. 行内サイズ, 字面行アセント, 字面行ディセント, 行アセント, 数学コンテンツの行アセントの計算.
      Calculation of inline size, ink line-ascent, ink line-descent, line-ascent and line-ascent of the math content.
    3. 数学コンテンツボックスの中での子要素ボックスの移動距離, および追加の描画される部品(線, 根号など)の移動距離の計算.
      Calculation of offsets of child boxes within the math content box as well as sizes and offsets of extra graphical items (bars, radical symbol, etc).
    4. [CSS-POSITION-3]で述べられているように, 絶対配置固定配置のボックスの配置と位置指定.
      Layout and positioning of absolutely-positioned and fixed-positioned boxes, as described in [CSS-POSITION-3].

次の追加の工程が実施されなければなりません.

The following extra steps must be performed:

注意
Note
上で述べたことによって, マージンの相殺は, MathML要素に適用されません.
Per the description above, margin-collapsing does not apply to MathML elements.

ボックスの配置の間, 任意の行内伸長サイズ制限ブロック伸長サイズ制限のパラメータは, 装飾された演算子において使用されてもよいです. 前者は, 行内軸に沿って伸長された核となる演算子が覆うべき対象のサイズを意図します. 後者は, ブロック軸に沿って伸長された核となる演算子が覆うべき字面行アセント字面行ディセントを意図します. 他で何ら指定されない限り, これらのパラメータは, ボックスの配置の間, 無視され, 子要素ボックスは, 伸長サイズ制限無しに配置されます.

During box layout, optional inline stretch size constraint and block stretch size constraint parameters may be used on embellished operators. The former indicates a target size that a core operator stretched along the inline axis should cover. The latter indicates an ink line-ascent and ink line-descent that a core operator stretched along the block axis should cover. Unless specified otherwise, these parameters are ignored during box layout and child boxes are laid out without any stretch size constraint.

課題76: 何に対して行内の百分率を計算するかを明確化します. css/html5need specification updateneeds-tests
Issue 76: Define what inline percentages resolve against.
何に対して行内の百分率を計算するかを明確化します.
Define what inline percentages resolve against
課題77: 何に対してブロックの百分率を計算するかを明確化します. css/html5need specification updateneeds-tests
Issue 77: Define what block percentages resolve against.
何に対してブロックの百分率を計算するかを明確化します.
Define what block percentages resolve against

3.1.3 名前無し<mrow>ボックス
Anonymous <mrow> boxes

名前無しボックスは, DOM木構造の中に関連する要素を持たないボックスで, 配置の目的のみのために生成されます. 名前無しボックスのプロパティは, 囲っている名前無しでないボックスから継承され, 継承されないプロパティは, 初期値を持ちます. 名前無し<mrow>ボックスは, block mathに等しいdisplayを持つ名前無しボックスで, 3.3.1.2 <mrow>の配置の節で述べられているように配置されます.

An anonymous box is a box without any associated element in the DOM tree and which is generated for layout purpose only. The properties of anonymous boxes are inherited from the enclosing non-anonymous box while non-inherited properties have their initial value. An anonymous <mrow> box is an anonymous box with display equal to block math and which is laid out as described in section 3.3.1.2 Layout of <mrow>.

MathML要素が名前無し<mrow>ボックスを生成する場合, そのボックスは, 名前無し<mrow>ボックスの中に子要素を包みます。すなわち, 視覚的書式モデルの中の一部の木構造が, それ自身がMathML要素の子要素に関連するボックスを含む, 名前無し<mrow>ボックスで作られます.

If a MathML element generates an anonymous <mrow> box if it wraps in children in an anonymous <mrow> box i.e. its subtree in the visual formatting model is made of an anonymous <mrow> box which itself contains the boxes associated to the children of this MathML element.

次に示す例において, math要素とmrow要素は, 3.3.1.2 <mrow>の配置の節で述べられているように配置されます. 特に, <math>要素は, <mo>≠</mo>子要素の周りに適切な空白を加え, <mrow>要素は, <mo>|</mo>子要素を縦に伸長します.

In the following example, the math and mrow elements are laid out as described in section 3.3.1.2 Layout of <mrow>. In particular, the <math> element adds proper spacing around its <mo>≠</mo> child and the <mrow> element stretches its <mo>|</mo> children vertically.

mtd要素はdisplay: table-cellを持ち, msqrt要素は子要素の周りに根号を表示します. ただし, それらの要素は, 3.3.1.2 <mrow>の配置の節で述べられているものと同じような方法で子要素を配置します. <msqrt>要素は, <mo>+</mo>子要素の周りに適切な空白を加え, <mtd>要素は, <mo>子要素を縦に伸長します. このことを可能にするために, これら2つの要素は, それぞれ名前無し<mrow>ボックスを生成します.

The mtd element has display: table-cell and the msqrt element displays a radical symbol around its children. However, they also place their children in a way that is similar to what is described in section 3.3.1.2 Layout of <mrow>: the <msqrt> element adds proper spacing around its <mo>+</mo> child while the <mtd> element stretches its <mo> children vertically. In order to make this possible, each of these two elements generates an anonymous <mrow> box.

<math>
  <mrow>
    <mo>|</mo>
    <mtable>
      <mtr>
        <mtd>
          <mi>x</mi>
        </mtd>
        <mtd>
          <mo>(</mo>
          <mfrac linethickness="0">
            <mn>5</mn>
            <mn>3</mn>
          </mfrac>
          <mo>)</mo>
        </mtd>
      </mtr>
      <mtr>
        <mtd>
          <msqrt>
            <mn>7</mn>
            <mo>+</mo>
            <mn>2</mn>
          </msqrt>
        </mtd>
        <mtd>
          <mi>y</mi>
        </mtd>
      </mtr>
    </mtable>
    <mo>|</mo>
  </mrow>
  <mo></mo>
  <mn>0</mn>
</math>
math example (display)

3.1.4 スタックコンテキスト
Stacking contexts

MathML要素は, 様々な間隔を空ける決まりのために, 重ね合わせることができます. また, それらは, 追加の描画される部品(線, 根号など)を含むことができます. 書式の算出値としてdisplay: block mathまたはdisplay: inline mathを持つMathML要素は, 新しいスタックコンテキストを生み出します. そのようなMathML要素のフロー内子要素の描画順序は, 厳密にブロック要素と同じです. 追加の描画される部品は, 文字列と背景の後に描画されます(display: inline mathに対する7.2.4の工程の後に調整され, display: block mathに対する7.2の工程の後に調整されます).

MathML elements can overlap due to various spacing rules. They can as well contain extra graphical items (bars, radical symbol, etc). A MathML element with computed style display: block math or display: inline math generates a new stacking context. The painting order of in-flow children of such a MathML element is exactly the same as block elements. The extra graphical items are painted after text and background (right after step 7.2.4 for display: inline math and right after step 7.2 for display: block math).

3.2 素子要素
Token Elements

プレゼンテーションマークアップの素子要素は, ざっくり言うと, 意味を伝達する数学表記の最小の単位を表すよう意図されています. 素子は, おおまかに言って, 文章の中の言葉と似ています. ただし, 数学表記の精密で象徴的な特性から, 素子要素の様々な種類や性質がMathMLマークアップの中で重要な役割を果たします. 対照的に, 文章データの中では, 個々の言葉は, めったにマークアップされたり, 特別な書式にされたりする必要はありません.

Token elements in presentation markup are broadly intended to represent the smallest units of mathematical notation which carry meaning. Tokens are roughly analogous to words in text. However, because of the precise, symbolic nature of mathematical notation, the various categories and properties of token elements figure prominently in MathML markup. By contrast, in textual data, individual words rarely need to be marked up or styled specially.

注意
Note
実際のところ, ほとんどのMathML素子要素は, 変数, 数字, 演算子などに対する単純な文字列を含むのみで, 凝った配置は必要としません. ただし, 素子要素は, 改行を伴う文章や任意のHTML5フレージング要素を含むことができます.
In practice, most MathML token elements just contain simple text for variables, numbers, operators etc and don't need sophisticated layout. However, it can contain text with line breaks or arbitrary HTML5 phrasing elements.

3.2.1 文章<mtext>
Text <mtext>

mtext要素は, 文章自体として描画されるべき任意の文章を表すのに使われます. 一般に, mtext要素は, 注釈の文章を示すよう意図されています.

The mtext element is used to represent arbitrary text that should be rendered as itself. In general, the <mtext> element is intended to denote commentary text.

<mtext>要素は, 2.1.3 共通の属性で述べられている属性を持ちます.

The <mtext> element accepts the attributes described in 2.1.3 Global Attributes.

次の例において, mtextは, 定義における条件の言葉を記入するのに使用されています.

In the following example, mtext is used to put conditional words in a definition:

<math>
  <mi>y</mi>
  <mo>=</mo>
  <mrow>
    <msup>
      <mi>x</mi>
      <mn>2</mn>
    </msup>
    <mtext>&nbsp;if&nbsp;</mtext>
    <mrow>
      <mi>x</mi>
      <mo></mo>
      <mn>1</mn>
    </mrow>
    <mtext>&nbsp;and&nbsp;</mtext>
    <mn>2</mn>
    <mtext>&nbsp;otherwise.</mtext>
  </mrow>
</math>
(訳注:"x≥1ならばy=x2, そうでなければ2"の意味)
mtext example
3.2.1.1 <mtext>の配置
Layout of <mtext>

要素が, block mathまたはinline mathに等しいdisplayプロパティの算出値を持たないならば, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. そうでなければ, 下記の配置が行われます.

If the element does not have its computed display property equal to block math or inline math then it is laid out according to the CSS specification where the corresponding value is described. Otherwise, the layout below is performed.

<mtext>要素が, 強制改行または自動折り返し機会の無い文章の中身のみを含むなら, 文章のために生成された名前無し子ノードは, 関係するCSS仕様書で定義されたように配置され, 次のとおりです.

If the <mtext> element contains only text content without forced line break or soft wrap opportunity then, the anonymous child node generated for that text is laid out as defined in the relevant CSS specification and:

そうでない場合, mtext要素はブロックボックスとして配置され, ブロックボックスのものに対応する最小内容行内サイズ, 最大内容行内サイズ, 行内サイズ, ブロックサイズ, 最初の基準線集合, 最後の基準線集合は, 数学コンテンツボックスに対して使われます.

Otherwise, the mtext element is laid out as a block box and corresponding min-content inline size, max-content inline size, inline size, block size, first baseline set and last baseline set are used for the math content box.

3.2.2 識別子<mi>
Identifier <mi>

mi要素は, 識別子として表示されるべき記号の名前や何らかの文字列を表します. 識別子には, 変数, 関数名, 定数の記号が含まれます.

The mi element represents a symbolic name or arbitrary text that should be rendered as an identifier. Identifiers can include variables, function names, and symbolic constants.

<mi>要素は, 2.1.3 共通の属性で述べられている属性と, 次の属性を持ちます.

The <mi> element accepts the attributes described in 2.1.3 Global Attributes as well as the following attribute:

配置アルゴリズムは, mtext要素と同じです. ユーザーエージェントのスタイルシートは, 4.2 新しいtext-transformの値で導入するtext-transformの値を通じて自動でのイタリック体を実装するために, 次のプロパティを含まなければなりません.

The layout algorithm is the same as the mtext element. The user agent stylesheet must contain the following property in order to implement automatic italic via the text-transform value introduced in 4.2 New text-transform value:

mi {
  text-transform: math-auto;
}

mathvariant属性は, もし存在するなら大文字・小文字は区別せずにnormalに一致しなければなりません. その場合, ユーザーエージェントは, この属性を要素のtext-transformプロパティをnoneに設定する表現の助言として, この属性を取り扱うことが期待されます. 他の場合, 何も効果を持ちません.

The mathvariant attribute, if present, must be an ASCII case-insensitive match of normal. In that case, the user agent is expected to treat the attribute as a presentational hint setting the element's text-transform property to none. Otherwise it has no effects.

注意
Note

[MathML3]では, mathvariant属性は, 素子要素の論理的な種類を定義するのに使われていました. それぞれの論理的な種類は, 与えられた数式の中で特定の意味を持つ, 植字に関連する記号素子の集合を提供していました.

In [MathML3], the mathvariant attribute was used to define logical classes of token elements, each class providing a collection of typographically-related symbolic tokens with specific meaning within a given mathematical expression.

MathMLコアでは, この属性は, mi要素を自動的にイタリック体にすることを取り消すためにのみ使用されます. 他の利用方法に対しては, より適切な数学用英数字記号[ユニコード]が代わりに用いられるべきです. C. 数学用英数字記号の節も参照して下さい.

In MathML Core, this attribute is only used to cancel automatic italic of the mi element. For other use cases, the proper Mathematical Alphanumeric Symbols [UNICODE] should be used instead. See also section C. Mathematical Alphanumeric Symbols.

次の例において, miは, 変数と関数名を描画するのに使用されています. 単独の文字を含む識別子は, 通常, イタリック体になることに注意して下さい.

In the following example, mi is used to render variables and function names. Note that identifiers containing a single letter are italic by default.

<math>
  <mi>cos</mi>
  <mo>,</mo>
  <mi>c</mi>
  <mo>,</mo>
  <mi mathvariant="normal">c</mi>
</math>
mi example

3.2.3 数字<mn>
Number <mn>

mn要素は, "数値の文字列"や数値の文字列として描画されるべき他のデータを表します. 一般に言って, 数値の文字列は数字の列で, 場合によっては小数点を含み, 符号の付かない整数または実数を表します.

The mn element represents a "numeric literal" or other data that should be rendered as a numeric literal. Generally speaking, a numeric literal is a sequence of digits, perhaps including a decimal point, representing an unsigned integer or real number.

<mn>要素は, § 2.1.3 共通の属性で述べられている属性を持ちます. その配置アルゴリズムは, mtext要素と同じです.

The <mn> element accepts the attributes described in 2.1.3 Global Attributes. Its layout algorithm is the same as the mtext element.

次の例において, mnは小数を書くのに使用されています.

In the following example, mn is used to write a decimal number.

<math>
  <mn>3.141592653589793</mn>
</math>
mn example

3.2.4 演算子, かっこ, 区切り, アクセント<mo>
Operator, Fence, Separator or Accent <mo>

mo要素は, 演算子や演算子として描画すべきものを表します. 一般に, 数学の演算子の表記の慣習は大変複雑です. MathMLは, <mo>要素の描画するときの挙動を特定する比較的洗練された仕組みを提供しています.

The mo element represents an operator or anything that should be rendered as an operator. In general, the notational conventions for mathematical operators are quite complicated, and therefore MathML provides a relatively sophisticated mechanism for specifying the rendering behavior of an <mo> element.

結果として, MathMLにおいて"演算子として描画される"べきものの一覧は, 普通の感覚では数学の演算子ではない数学表記を含んでいます. 中間や前や後ろに置かれる普通の演算子の他に, その一覧は, 大かっこや丸かっこや"絶対値"の縦棒といった囲い文字, コンマやセミコロンといった区切り, 記号の上の横棒やチルダといった数学のアクセントを含みます. この章では, "演算子"という用語を広い意味で演算子を表すものに使用します.

As a consequence, in MathML the list of things that should "render as an operator" includes a number of notations that are not mathematical operators in the ordinary sense. Besides ordinary operators with infix, prefix, or postfix forms, these include fence characters such as braces, parentheses, and "absolute value" bars; separators such as comma and semicolon; and mathematical accents such as a bar or tilde over a symbol. This chapter uses the term "operator" to refer to operators in this broad sense.

<mo>要素は, 2.1.3 共通の属性で述べられている属性と, 次の属性を持ちます.

The <mo> element accepts the attributes described in 2.1.3 Global Attributes as well as the following attributes:

この仕様書は, fence属性とseparator属性に指定する何ら注目すべき挙動を定義していません.

This specification does not define any observable behavior that is specific to the fence and separator attributes.

注意
Note
著者は, 演算子の特定の意味を述べるのに, fenceseparatorを使ってもよいです. 既定値は, Operators_fenceテーブルおよびOperators_separatorテーブルから決定されるか, もしくは演算子辞書の人が判読できるバージョンと等価であってよいです.
Authors may use the fence and separator to describe specific semantics of operators. The default values may be determined from the Operators_fence and Operators_separator tables, or equivalently the human-readable version of the operator dictionary.

次の例において, mo要素は, 二項演算子+に対して使用されています. 通常の間隔の取り方では, 演算子の周囲に左右対称に取ります. その演算子が前置演算子として取り扱われるよう強制するのにform属性を頼ったなら, 隙間の無い間隔の取り方が利用されます. 間隔の取り方は, 明確にlspace属性とrspace属性を用いて, 指定することもできます.

In the following example, the mo element is used for the binary operator +. Default spacing is symmetric around that operator. A tigher spacing is used if you rely on the form attribute to force it to be treated as a prefix operator. Spacing can also be specified explicitly using the lspace and rspace attributes.

<math>
  <mn>1</mn>
  <mo>+</mo>
  <mn>2</mn>
  <mo form="prefix">+</mo>
  <mn>3</mn>
  <mo lspace="2em">+</mo>
  <mn>4</mn>
  <mo rspace="3em">+</mo>
  <mn>5</mn>
</math>
mo example 1

もう1つの例は, 総和のよう大きな演算子に対するものです. displaystyleがtrueの場合, そのような演算子は, 大きく描画されますが, largeop属性によって変更できます. displaystyleがfalseの場合, 下側の添え字は, 実際のところ, 下付きの添え字として描画されますが, movablelimits属性によって変更できます.

Another use case is for big operators such as summation. When displaystyle is true, such an operator is drawn larger but one can change that with the largeop attribute. When displaystyle is false, underscripts are actually rendered as subscripts but one can change that with the movablelimits attribute.

<math>
  <mrow displaystyle="true">
  <munder>
    <mo></mo>
    <mn>5</mn>
  </munder>
  <munder>
    <mo largeop="false"></mo>
    <mn>6</mn>
  </munder>
  </mrow>
  <mrow>
    <munder>
      <mo></mo>
      <mn>5</mn>
    </munder>
    <munder>
      <mo movablelimits="false"></mo>
      <mn>7</mn>
    </munder>
  </mrow>
</math>
mo example 2

演算子は, かっこ, アクセント, 矢印などといった伸長される記号としても使用されます. 次の例では, 縦の矢印がmspace要素の高さに伸長されています. 例えば, 伸長されない矢印を強調するためにstretchy属性を用いて, 通常の伸長される挙動を上書きできます. symmetric属性は, 演算子が数学軸(分数の線)の上下で対象に伸長すべきかどうか示すことを可能にします. 最終的に, minsize属性とmaxsize属性は, 伸長されるサイズに追加の制限を加えます.

Operators are also used for stretchy symbols such as fences, accents, arrows etc. In the following example, the vertical arrow stretches to the height of the mspace element. One can override default stretch behavior with the stretchy attribute e.g. to force an unstretched arrow. The symmetric attribute allows to indicate whether the operator should stretch symmetrically above and below the math axis (fraction bar). Finally the minsize and maxsize attributes add additional constraints over the stretch size.

<math>
  <mfrac>
    <mspace height="50px" depth="50px" width="10px" style="background: blue"/>
    <mspace height="25px" depth="25px" width="10px" style="background: green"/>
  </mfrac>
  <mo></mo>
  <mo stretchy="false"></mo>
  <mo symmetric="true"></mo>
  <mo minsize="250px"></mo>
  <mo maxsize="50px"></mo>
</math>
mo example 3

演算子のプロパティの既定値は, 3.2.4.2 辞書を基にした属性で説明されているように, 辞書を基にしていることに注意して下さい. 例えば, 二項演算子は, 典型的に初期状態で, 周囲に左右対称な間隔を持ち, 一方, かっこは, 初期状態で一般に伸長されます.

Note that the default properties of operators are dictionary-based, as explained in 3.2.4.2 Dictionary-based attributes. For example a binary operator typically has default symmetric spacing around it while a fence is generally stretchy by default.

3.2.4.1 装飾された演算子
Embellished operators

MathMLコア要素は, 次の場合, 装飾された演算子です.

A MathML Core element is an embellished operator if it is:

  1. mo要素.
    An mo element;
  2. 最初のフロー内子要素が存在し, その要素が装飾された演算子である, 添え字要素またはmfrac.
    a scripted element or an mfrac, whose first in-flow child exists and is an embellished operator;
  3. フロー内子要素が(順番によらず)1個の装飾された演算子と0個以上の空白のような要素から構成される, グループ要素またはmpadded.
    a grouping element or mpadded, whose in-flow children consist (in any order) of one embellished operator and zero or more space-like elements.

装飾された演算子核となる演算子は, 次のとおり再帰的に定義された<mo>要素です.

The core operator of an embellished operator is the <mo> element defined recursively as follows:

  1. mo要素の核となる演算子は, その要素自身です.
    The core operator of an mo element; is the element itself.
  2. 装飾された添え字要素またはmfrac要素の核となる演算子は, 最初のフロー内子要素の核となる演算子です.
    The core operator of an embellished scripted element or mfrac element is the core operator of its first in-flow child.
  3. 装飾されたグループ要素またはmpaddedの核となる演算子は, ただ1つの装飾された演算子フロー内子要素の核となる演算子です.
    The core operator of an embellished grouping element or mpadded is the core operator of its unique embellished operator in-flow child.

装飾された演算子伸長軸は, 単独の文字cが行内軸方向の固有の伸長軸を持っていて, 核となる演算子がその文字のみから構成される文字列だけを含んでいるなら, 行内軸です. そうでなければ, 装飾された演算子の伸長軸は, ブロック軸です.

The stretch axis of an embellished operator is inline if its core operator contains only text content made of a single character c, and that character has inline intrinsic stretch axis. Otherwise, the stretch axis of the embellished operator is block.

名前無し<mrow> ボックスグループ要素として扱われる場合には, 同じ定義が, 視覚的書式モデルにおけるボックスに適用されます.

The same definitions apply for boxes in the visual formatting model where an anonymous <mrow> box is treated as a grouping element.

3.2.4.2 辞書を基にした属性
Dictionary-based attributes

装飾された演算子formプロパティは, infix, prefix, postfixのいずれかです. mo要素における, このプロパティに対応するform属性は, もし存在するなら, 大文字・小文字を区別せずにそれらの値の1つに一致しなければなりません.

The form property of an embellished operator is either infix, prefix or postfix. The corresponding form attribute on the mo element, if present, must be an ASCII case-insensitive match to one of these values.

装飾された演算子formを決定するためのアルゴリズムは, 次のとおりです.

The algorithm for determining the form of an embellished operator is as follows:

  1. form属性が存在し, 核となる演算子で有効な場合, その全て小文字にした値が使用されます.
    If the form attribute is present and valid on the core operator, then its ASCII lowercased value is used.
  2. 装飾された演算子が, グループ要素, mpadded, msqrtの最初のフロー内子要素で, (全ての空白のような要素を無視したうえで)1つ以上のフロー内子要素と一緒の場合, その演算子はprefix形式を持ちます.
    If the embellished operator is the first in-flow child of a grouping element, mpadded or msqrt with more than one in-flow child (ignoring all space-like children) then it has form prefix.
  3. または, 装飾された演算子が, グループ要素, mpadded, msqrtの最後のフロー内子要素で, (全ての空白のような子要素を無視したうえで)1つ以上のフロー内子要素と一緒の場合, その演算子はpostfix形式を持ちます.
    Or, if the embellished operator is the last in-flow child of a grouping element, mpadded or msqrt with more than one in-flow child (ignoring all space-like children) then it has form postfix.
  4. または, 装飾された演算子が添え字要素フロー内要素で, 最初のフロー内子要素でない場合, その演算子はpostfix形式を持ちます.
    Or, if the embellished operator is an in-flow child of a scripted element, other than the first in-flow child, then it has form postfix.
  5. そうでない場合, 装飾された演算子は, infix形式を持ちます.
    Otherwise, the embellished operator has form infix.

装飾された演算子stretchyプロパティ, symmetricプロパティ, largeopプロパティ, movablelimitsプロパティは, falseまたはtrueです. 後者の場合, 装飾された演算子はそのプロパティを持つと言われます. mo要素において, これらのプロパティに対応するstretchy属性, symmetric属性, largeop属性, movablelimits属性は, もし存在するなら, ブール値でなければなりません.

The stretchy, symmetric, largeop, movablelimits properties of an embellished operator are either false or true. In the latter case, it is said that the embellished operator has the property. The corresponding stretchy, symmetric, largeop, movablelimits attributes on the mo element, if present, must be a boolean.

装飾された演算子lspaceプロパティ, rspaceプロパティ, minsizeプロパティは, <length-percentage>(訳注:長さや百分率)です. 装飾された演算子maxsizeプロパティは, <length-percentage>または∞のどちらかです. mo要素のlspace属性, rspace属性, minsize属性, maxsize属性は, もし存在するなら, <length-percentage>でなければなりません.

The lspace, rspace, minsize properties of an embellished operator are <length-percentage>. The maxsize property of an embellished operator is either a <length-percentage> or ∞. The lspace, rspace, minsize and maxsize attributes on the mo element, if present, must be a <length-percentage>.

装飾された演算子のプロパティを決定するアルゴリズムは, 次のとおりです.

The algorithm for determining the properties of an embellished operator is as follows:

  1. 対応するstretchy, symmetric, largeop, movablelimits, lspace, rspace, maxsize, minsizeの属性が存在し,核となる演算子で有効な場合, その全て小文字にした値が使用されます.
    If the corresponding stretchy, symmetric, largeop, movablelimits, lspace, rspace, maxsize or minsize attribute is present and valid on the core operator, then the ASCII lowercased value of this property is used.
  2. そうでない場合, 装飾された演算子のformを決定するためのアルゴリズムが実行されます.
  3. 核となる演算子が文字列の中身Contentのみを含んでいる場合, 前の工程で計算されたformFormとして, 演算子の種類を決定するアルゴリズム(Content, Form)の結果に, Categoryを設定します.
    If the core operator contains only text content Content, then set Category to the result of the algorithm to determine the category of an operator (Content, Form) where Form is the form calculated at the previous step.
  4. CategoryDefaultで, 装飾された演算子form核となる演算子の属性として明確に指定されていなかった場合, 次のとおりです.
    If Category is Default and the form of embellished operator was not explicitly specified as an attribute on its core operator:
    1. Forminfixとした場合の演算子の種類を決定するアルゴリズムの結果に, Categoryを設定します.
      Set Category to the result of the algorithm to determine the category of an operator (Content, Form) where Form is infix.
    2. CategoryDefaultの場合, Formpostfixに設定して再度上のアルゴリズムを実行します.
      If Category is Default, then run the algorithm again with Form set to postfix.
    3. CategoryDefaultの場合, Formprefixに設定して再度上のアルゴリズムを実行します.
      If Category is Default, then run the algorithm again with Form set to prefix.
  5. 演算子の種類Categoryから演算子のプロパティを決定するアルゴリズムを実行します.

配置の途中で利用される場合, stretchy, symmetric, largeop, movablelimits, lspace, rspace, minsizeの値は, 次の追加の決まりと一緒に装飾された演算子のプロパティを決定するアルゴリズムによって得られます.

When used during layout, the values of stretchy, symmetric, largeop, movablelimits, lspace, rspace, minsize are obtained by the algorithm for determining the properties of an embellished operator with the following extra resolutions:

  • lspace, rspaceに対する百分率の値は, 辞書から読み取られた値, または上で述べた予備の値に対するものと解釈されます.
    Percentage values for lspace, rspace are interpreted relative to the value read from the dictionary or to the fallback value above.
  • minsizemaxsizeに対する百分率の値の解釈は, 3.2.4.3 演算子の配置で述べています.
    Interpretation of percentage values for minsize and maxsize are described in 3.2.4.3 Layout of operators.
  • lspace, rspace, minsize, maxsizeに対するフォントに関連する長さは, 装飾された演算子のフォント書式ではなく, 核となる演算子の書式に対して決まります.
    Font-relative lengths for lspace, rspace, minsize and maxsize rely on the font style of the core operator, not the one of the embellished operator.
3.2.4.3 演算子の配置
Layout of operators

<mo>要素が, block mathまたはinline mathに等しいdisplayプロパティの算出値を持たないならば, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. そうでなければ, 下記の配置が行われます.

If the <mo> element does not have its computed display property equal to block math or inline math then it is laid out according to the CSS specification where the corresponding value is described. Otherwise, the layout below is performed.

演算子の文字列は, <mo>要素のvisibilityvisibleの場合のみ, 描画されなければなりません. その場合, <mo>要素のcolorで描画されなければなりません.

The text of the operator must only be painted if the visibility of the <mo> element is visible. In that case, it must be painted with the color of the <mo> element.

演算子は, 次のとおり配置されます.

Operators are laid out as follows:

  1. <mo>要素の中身が単独の文字cから成り立っている訳ではない場合, 3.2.1.1 <mtext>の配置の配置アルゴリズムを利用します.
    If the content of the <mo> element is not made of a single character c then fall back to the layout algorithm of 3.2.1.1 Layout of <mtext>.
  2. 演算子がstretchyプロパティを持っている場合.
    If the operator has the stretchy property:
  3. 演算子がlargeopプロパティを持っていて, <mo>要素のmath-stylenormalの場合, 次のとおりです.
    If the operator has the largeop property and if math-style on the <mo> element is normal, then:
    1. 少なくともDisplayOperatorMinHeightの高さの字形を試したり見つけたりするために, MathVariantsテーブルを利用します. 何も見つからなかった場合, 最も大きい基本とならない字形が予備として使われます. 何も見つからなかった場合, 3.2.1.1 <mtext>の配置の配置アルゴリズムを利用します.

      Use the MathVariants table to try and find a glyph of height at least DisplayOperatorMinHeight. If none is found, fall back to the largest non-base glyph. If none is found, fall back to the layout algorithm of 3.2.1.1 Layout of <mtext>.

    2. 演算子の数学コンテンツの最小内容行内サイズ, 最大内容行内サイズ, 行内サイズ, ブロックの尺度は, 見つかった字形によって与えられます.
      The min-content inline size, max-content inline size, inline size and block metrics of the math content are given by the glyph found.
    3. 字形を描画します.
      Paint the glyph.
    8 総和記号の基となるサイズとディスプレイスタイルの(大きな)サイズ
    Figure 8 Base and displaystyle sizes of the summation symbol
  4. その他の場合は, § 3.2.1.1 <mtext>の配置の配置アルゴリズムを利用します.
    Otherwise fall back to the layout algorithm of 3.2.1.1 Layout of <mtext>.

伸長された字形を形作るアルゴリズムが, 上記の工程のどこかで利用される場合, 演算子の数学コンテンツのイタリック補正は, そのアルゴリズムによって返された値に設定されます.

If the algorithm to shape a stretchy glyph has been used for one of the step above, then the italic correction of the math content is set to the value returned by that algorithm.

注意
Note
maxsizeがその既定値である∞と等しい場合, minsize ≤ maxsizeは満たされますが, maxsize < Tは満たされません.
If maxsize is equal to its default value ∞ then minsize ≤ maxsize is satisfied but maxsize < T is not.

3.2.5 空白 <mspace>
Space <mspace>

mspace空要素は, 属性により設定された何らかの望ましい大きさの空白を表します.

The mspace empty element represents a blank space of any desired size, as set by its attributes.

<mspace>要素は, 2.1.3 共通の属性で述べられている属性と, 次の属性を持ちます.

The <mspace> element accepts the attributes described in 2.1.3 Global Attributes as well as the following attributes:

width, height, depthは, もし存在するなら, 有効な<length-percentage>(訳注:長さや百分率)である値を持たなければなりません.

The width, height, depth, if present, must have a value that is a valid <length-percentage>.

  • width属性が存在し, 百分率でない有効な値の場合, その属性は, 要素のwidthプロパティをその属性値に対応する値に設定する表現の助言として使用されます.
    If the width attribute is present, valid and not a percentage then that attribute is used as a presentational hint setting the element's width property to the corresponding value.
  • height属性が存在しないか, 無効な値か百分率の場合, 所要の行アセントは0です. そうでない場合, 所要の行アセントは, 負の数を0に固定した, height属性の解決値です.
    If the height attribute is absent, invalid or a percentage then the requested line-ascent is 0. Otherwise the requested line-ascent is the resolved value of the height attribute, clamping negative values to 0.
  • height属性とdepth属性が存在し, 百分率でない有効な値の場合, 要素のheightプロパティを, "calc(", height属性の値, " + ", depth属性の値, ")"を連結した文字列に設定する表現の助言として使用されます. それらの属性のうち1つしか存在せず, 百分率でない有効な値の場合, 要素のheightプロパティを対応する属性値に設定する表現の助言として扱われます.
    If both the height and depth attributes are present, valid and not a percentage then they are used as a presentational hint setting the element's height property to the concatenation of the strings "calc(", the height attribute value, " + ", the depth attribute value, and ")". If only one of these attributes is present, valid and not a percentage then it is treated as a presentational hint setting the element's height property to the corresponding value.

次の例において, mspaceは, 式の中の空白を強制するために使用されています(1px幅の青線は空白が簡単に確認できるように加えられています).

In the following example, mspace is used to force spacing within the formula (a 1px blue border is added to easily visualize the space):

<math>
  <mn>1</mn>
  <mspace width="1em"
          style="border-top: 1px solid blue"/> 
  <mfrac>
    <mrow>
      <mn>2</mn>
      <mspace depth="1em"
              style="border-left: 1px solid blue"/>
    </mrow>
    <mrow>
      <mn>3</mn>
      <mspace height="2em"
              style="border-left: 1px solid blue"/>
    </mrow>
  </mfrac>
</math>
mspace example

<mspace>要素が, block mathまたはinline mathに等しいdisplayプロパティの算出値を持たない場合, その要素は, 指定されたプロパティに対応する値に述べているCSS仕様書によって配置されます. そうでなければ, <mspace>要素は, 9で示されたように配置されます. 数学コンテンツの最小内容行内サイズ, 最大内容行内サイズ, 行内サイズは, widthプロパティの解決値に等しいです. 数学コンテンツのブロックサイズは, heightプロパティの解決値に等しいです. 数学コンテンツの行アセントは, 上記で決めた所要の行アセントに等しいです.

If the <mspace> element does not have its computed display property equal to block math or inline math then it is laid out according to the CSS specification where the corresponding value is described. Otherwise, the <mspace> element is laid out as shown on Figure 9. The min-content inline size, max-content inline size and inline size of the math content are equal to the resolved value of the width property. The block size of the math content is equal to the resolved value of the height property. The line-ascent of the math content is equal to the requested line-ascent determined above.

9 <mspace>要素に対するボックスモデル
Figure 9 Box model for the <mspace> element
注意
Note
高さ/深さという用語は, [MATHML3]から来ており, それら自身は[TEXBOOK]からもたらされました.
The terminology height/depth comes from [MATHML3], itself inspired from [TEXBOOK].
3.2.5.1 空白のような要素の定義
Definition of space-like elements

数々のMathMLプレゼンテーション要素が, 典型的に空白として描画され, それらが現れても式の数学的意味に影響を与えないという点で"空白のような要素"です. 結果として, それらの要素は, 他のMathMLの式で, 多少異なる機能を持っています.

A number of MathML presentation elements are "space-like" in the sense that they typically render as whitespace, and do not affect the mathematical meaning of the expressions in which they appear. As a consequence, these elements often function in somewhat exceptional ways in other MathML expressions.

次のことに当てはまるなら, そのMathMLコア要素空白のような要素です.

A MathML Core element is a space-like element if it is:

  1. mtextまたはmspace.
    an mtext or mspace;
  2. フロー内子要素が全て空白のような要素であるグループ要素またはmpadded.
    or a grouping element or mpadded all of whose in-flow children are space-like.

名前無し<mrow> ボックスグループ要素として扱われる場合には, 同じ定義が, 視覚的書式モデルにおけるボックスに適用されます.

The same definitions apply for boxes in the visual formatting model where an anonymous <mrow> box is treated as a grouping element.

注意
Note
mphantomは, その中身が空白のような要素でない場合, 自動的には空白のような要素と定義されていないことに注意して下さい. これは, 演算子の間隔が隣接する要素が空白の要素であるかどうかによって影響を受けるためです. <mphantom>要素は第一に式を揃えることの助けとなることを意図しているので, <mphantom>に隣接する要素は, <mphantom>と同じ大きさの空白とではなく, <mphantom>の中身に隣接しているかのようにふるまうべきです.
Note that an mphantom is not automatically defined to be space-like, unless its content is space-like. This is because operator spacing is affected by whether adjacent elements are space-like. Since the <mphantom> element is primarily intended as an aid in aligning expressions, operators adjacent to an <mphantom> should behave as if they were adjacent to the contents of the <mphantom>, rather than to an equivalently sized area of whitespace.

3.2.6 文字列 <ms>
String Literal <ms>

ms要素は, 数式処理システムや"プログラミング言語"を含む他のシステムで解釈されるであろう式の中の"文字列"を表すのに使われます.

ms element is used to represent "string literals" in expressions meant to be interpreted by computer algebra systems or other systems containing "programming languages".

<ms>要素は, 2.1.3 共通の属性で述べられている属性を持ちます. この要素の配置アルゴリズムは, mtextと同じです.

The <ms> element accepts the attributes described in 2.1.3 Global Attributes. Its layout algorithm is the same as the mtext element.

次の例において, msは文字そのままの文字列を書くのに利用されています.

In the following example, ms is used to write a literal string of characters:

<math>
  <mi>s</mi>
  <mo>=</mo>
  <ms>"hello world"</ms>
</math>
ms example
注意
Note
MathML3では, 開始と終了の引用符として使われる文字をそれぞれ指定するのに, lquote属性とrquote属性を利用することができました. それらは, もはや対応されておらず, その代わり, 引用符は<ms>の文字列の一部として指定されなければなりません. 視覚的な描画を保つために従来の文書にCSSの決まりを加えることができます. 例えば, 左から右の方向において次のとおりです.
In MathML3, it was possible to use the lquote and rquote attributes to respectively specify the strings to use as opening and closing quotes. These are no longer supported and the quotes must instead be specified as part of the text of the <ms> element. One can add CSS rules to legacy documents in order to preserve visual rendering. For example, in left-to-right direction:
ms:before, ms:after {
  content: "\0022";
}
ms[lquote]:before {
  content: attr(lquote);
}
ms[rquote]:after {
  content: attr(rquote);
}

3.3 一般的な配置要素
General Layout Schemata

素子の他に, 様々な種類のMathMLプレゼンテーション要素があります. ある種類の要素は上付きの式や下付きの式といった様々な"添え字"の表記を扱います. もう1つの種類のものは行列や表に関係しています. この節で論じる残りの要素は, 分数や根号といった他の基本となる表記を記述したり, もしくは書式の特性を設定し, エラー処理を行うような一般的な機能を扱ったりします.

Besides tokens there are several families of MathML presentation elements. One family of elements deals with various "scripting" notations, such as subscript and superscript. Another family is concerned with matrices and tables. The remainder of the elements, discussed in this section, describe other basic notations such as fractions and radicals, or deal with general functions such as setting style properties and error handling.

3.3.1 式のグループ<mrow>
Group Sub-Expressions <mrow>

mrow要素は, 任意の数の式を一緒にグループ化するのに使われます. グループは, 通常, その中で"演算子"としてふるまう1つ以上の<mo>と, それらの"被演算子"となる1つ以上の式から構成されます.

The mrow element is used to group together any number of sub-expressions, usually consisting of one or more <mo> elements acting as "operators" on one or more other expressions that are their "operands".

次の例において, mrowは, 和"1 + 2/3"を分子(mfracの最初の子要素)としてグループ化し, かっこで囲われた5乗される式(msupの最初の子要素)を構成するのに使われています. mrowは, そのグループ化された中身に単独で視覚的なかっこを加えず, mo要素を使用して, 明確にそれらを指定しなければならないことに注意して下さい.

In the following example, mrow is used to group a sum "1 + 2/3" as a fraction numerator (first child of mfrac) and to construct a fenced expression (first child of msup) that is raised to the power of 5. Note that mrow alone does not add visual fences around its grouped content, one has to explicitly specify them using the mo element.

mrow要素の中で, 子要素の(欧文ベースラインまたは数学基準線による)縦方向の位置揃えが適切に実施され, かっこが縦方向に伸長され, 2項演算子+の周りの間隔が自動的に計算されることが分かるでしょう.

Within the mrow elements, one can see that vertical alignment of children (according to the alphabetic baseline or the mathematical baseline) is properly performed, fences are vertically stretched and spacing around the binary + operator automatically calculated.

<math>
  <msup>
    <mrow>
      <mo>(</mo>
      <mfrac>
        <mrow>
          <mn>1</mn>
          <mo>+</mo>
          <mfrac>
            <mn>2</mn>
            <mn>3</mn>
          </mfrac>
        </mrow>
        <mn>4</mn>
      </mfrac>
      <mo>)</mo>
    </mrow>
    <mn>5</mn>
  </msup>
</math>
mrow example

<mrow>要素は, § 2.1.3 共通の属性で述べられている属性を持ちます. フロー内の子要素child1, child2, … , childNを持つ<mrow>要素は, 10で示されているように配置されます. 子要素のボックスは, 全て欧文ベースラインで揃えられて, 1つ1つ1列に並べられます.

The <mrow> element accepts the attributes described in 2.1.3 Global Attributes. An <mrow> element with in-flow children child1, child2, …, childN is laid out as shown on Figure 10. The child boxes are put in a row one after the other with all their alphabetic baselines aligned.

10 <mrow>要素に対するボックスモデル
Figure 10 Box model for the <mrow> element
注意
Note
ボックスモデルが 欧文ベースラインの位置揃えを確かなものにすることから, 分数の線または上下対象に伸長された演算子は, 軸高さが全てのフロー内子要素で同一という典型的な状況で, 数学軸に沿っても揃えられるでしょう.
Because the box model ensures alignment of alphabetic baselines, fraction bars or symmetric stretchy operators will also be aligned along the math axis in the typical case when AxisHeight is the same for all in-flow children.
3.3.1.1 ブロック軸に沿って伸長される演算子に対するアルゴリズム
Algorithm for stretching operators along the block axis
11 ブロック軸に沿った対称や非対称の演算子の伸長
Figure 11 Symmetric and non-symmetric stretching of operators along the block axis

ブロック軸に沿って伸長される演算子に対するアルゴリズムは, 次の工程で構成されています.

The algorithm for stretching operators along the block axis consists in the following steps:

  1. ブロック伸長サイズ制限または行内伸長サイズ制限がある場合, 配置される要素は, 装飾された演算子です. 装飾された演算子である1つのフロー内子要素を, 同じ伸長サイズ制限を伴って配置し, 他の全てのフロー内子要素を何ら伸長サイズ制限無しに配置し, 完了します.
    If there is a block stretch size constraint or an inline stretch size constraint then the element being laid out is an embellished operator. Lay out the one in-flow child that is an embellished operator with the same stretch size constraint and all the other in-flow children without any stretch size constraint and stop.
  2. そうでない場合, フロー内子要素の一覧を, stretchyプロパティとブロック伸長軸を持つ装飾された演算子を含む最初の一覧LToStretchと2番目の一覧LNotToStretchに分けます.
    Otherwise, split the list of in-flow children into a first list LToStretch containing embellished operators with a stretchy property and block stretch axis; and a second list LNotToStretch.
  3. LNotToStretchの全ての中身で, 何ら伸長サイズ制限なしに配置を実施します. もし, LToStretchが空の場合, 完了します. LNotToStretchが空の場合, LToStretchの全ての中身で, 伸長サイズ制限0として配置を実施します.
    Perform layout without any stretch size constraint on all the items of LNotToStretch. If LToStretch is empty then stop. If LNotToStretch is empty, perform layout with stretch size constraint 0 on all the items of LToStretch.
  4. 前の工程で配置されたフロー内子要素のマージンボックスの最大字面アセントと最大字面ディセントとして, 制限の無い目標のサイズUascentUdescentをそれぞれ計算します.
    Calculate the unconstrained target sizes Uascent and Udescent as respectively the maximum ink ascent and maximum ink descent of the margin boxes of in-flow children that have been laid out in the previous step.
  5. LToStretchの全ての要素を, ブロック伸長サイズ制限(Uascent, Udescent)と共に配置または再配置します.
    Lay out or relayout all the elements of LToStretch with block stretch size constraint (Uascent, Udescent).
3.3.1.2 <mrow>の配置
Layout of <mrow>

ボックスが名前無し<mrow>ボックスでなく, 関連付けられた要素がblock mathまたはinline mathに等しいdisplayプロパティの算出値を持たないならば, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. そうでなければ, 下記の配置が行われます.

If the box is not an anonymous <mrow> box and the associated element does not have its computed display property equal to block math or inline math then it is laid out according to the CSS specification where the corresponding value is described. Otherwise, the layout below is performed.

子要素が装飾された演算子でなく, 0でないイタリック補正を持つなら, 子要素のボックスは傾いています.

A child box is slanted if it is not an embellished operator and has nonzero italic correction.

注意
Note
大きい演算子は, 0でないイタリック補正を持ってもよいですが, それらの演算子は, 添え字を付け加えるときに使用されます. もっと一般的に, 全ての装飾された演算子は, lspacerspaceで指定されたように, その周囲の間隔が計算されることから, 傾いていないように取り扱われます.
Large operators may have nonzero italic correction but that one is used when attaching scripts. More generally, all embellished operators are treated as non-slanted since the spacing around them is calculated as specified by lspace and rspace.

最小内容行内サイズ(または最大内容行内サイズ)は, 次のアルゴリズムを使用して計算されます.

The min-content inline size (respectively max-content inline size) are calculated using the following algorithm:

  1. ボックスがmath要素に一致するか, または, 装飾された演算子でなければ, add-spaceをtrueに設定します. そうでなければ, falseに設定します.
    Set add-space to true if the box corresponds to a math element or is not an embellished operator; and to false otherwise.
  2. inline-offsetを0に設定します.
    Set inline-offset to 0.
  3. previous-italic-correctionを0に設定します.
    Set previous-italic-correction to 0.
  4. フロー内子要素に対して次のことを行います.
    For each in-flow child:
    1. 子要素が傾いていないならば, inline-offsetprevious-italic-correction分増やします.
      If the child is not slanted, then increment inline-offset by previous-italic-correction.
    2. 子要素が装飾された演算子add-spaceがtrueならば, inline-offsetをその子要素のlspaceプロパティ分増やします.
      If the child is an embellished operator and add-space is true then increment inline-offset by its lspace property.
    3. inline-offsetを, 子要素のマージンボックス最小内容行内サイズ(または最大内容行内サイズ)分増やします.
      Increment inline-offset by the min-content inline size (respectively max-content inline size) of the child's margin box.
    4. 子要素が傾いているならば, previous-italic-correctionをその要素のイタリック補正に設定します. そうでなければ, 0に設定します.
      If the child is slanted then set previous-italic-correction to its italic correction. Otherwise set it to 0.
    5. 子要素が装飾された演算子add-spaceがtrueならば, inline-offsetをその子要素のrspaceプロパティ分増やします.
      If the child is an embellished operator and add-space is true then increment inline-offset by its rspace property.
  5. inline-offsetprevious-italic-correction分増やします.
    Increment inline-offset by previous-italic-correction.
  6. inline-offsetを返します.
    Return inline-offset.

フロー内子要素は, ブロック軸に沿って伸長される演算子に対するアルゴリズムを使用して配置されます.

The in-flow children are laid out using the algorithm for stretching operators along the block axis.

要素の数学コンテンツの行内サイズは, 数学コンテンツの最小内容行内サイズ最大内容行内サイズ の計算と同じように, フロー内子要素のマージンボックス行内サイズを代わりに使用して計算されます.

The inline size of the math content is calculated like the min-content inline size and max-content inline size of the math content, using the inline size of the in-flow children's margin boxes instead.

要素の数学コンテンツの字面行アセント(または行アセント)は, フロー内子要素全てのマージンボックスにおける字面行アセント(または行アセント)の最大値です. 同様に, 数学コンテンツの字面行ディセント(または行ディセント)は, フロー内子要素全てのマージンボックスにおける字面行ディセント(または字面行アセント)の最大値です.

The ink line-ascent (respectively line-ascent) of the math content is the maximum of the ink line-ascents (respectively line-ascents) of all the in-flow children's margin boxes. Similarly, the ink line-descent (respectively line-descent) of the math content is the maximum of the ink line-descents (respectively ink line-ascents) of all the in-flow children's margin boxes.

フロー内子要素の位置は, 次のアルゴリズムを使用して決められます.

The in-flow children are positioned using the following algorithm:

  1. ボックスがmathに一致するか, または, 装飾された演算子でなければ, add-spaceをtrueに設定します. そうでなければ, falseに設定します.
    Set add-space to true if the box corresponds to a math element or is not an embellished operator; and to false otherwise.
  2. inline-offsetを0に設定します.
    Set inline-offset to 0.
  3. previous-italic-correctionを0に設定します.
    Set previous-italic-correction to 0.
  4. フロー内子要素に対して次のことを行います.
    For each in-flow child:
    1. 子要素が傾いていないならば, inline-offsetprevious-italic-correction分増やします.
      If the child is not slanted, then increment inline-offset by previous-italic-correction.
    2. 子要素が装飾された演算子add-spaceがtrueならば, inline-offsetをその子要素のlspaceプロパティ分増やします.
      If the child is an embellished operator and add-space is true then increment inline-offset by its lspace property.
    3. 子要素の行内移動距離inline-offsetに設定し, 子要素のブロック移動距離を, 子要素の欧文ベースラインが全体の欧文ベースラインに揃えられるように設定します.
      Set the inline offset of the child to inline-offset and its block offset such that the alphabetic baseline of the child is aligned with the alphabetic baseline.
    4. inline-offsetを子要素のマージンボックス行内サイズ分増やします.
      Increment inline-offset by the inline size of the child's margin box.
    5. 子要素が傾いているならば, previous-italic-correctionをその要素のイタリック補正に設定します. そうでなければ, 0に設定します.
      If the child is slanted then set previous-italic-correction to its italic correction. Otherwise set it to 0.
    6. 子要素が装飾された演算子add-spaceがtrueならば, inline-offsetをその子要素のrspaceプロパティ分増やします.
      If the child is an embellished operator and add-space is true then increment inline-offset by its rspace property.

要素の数学コンテンツのイタリック補正は, previous-italic-correctionの最終的な値である, 最後のフロー内子要素のイタリック補正に設定されます.

The italic correction of the math content is set to the italic correction of the last in-flow child, which is the final value of previous-italic-correction.

3.3.2 分数 <mfrac>
Fractions <mfrac>

mfrac要素は分数に使用されます. また, 二項係数やルジャンドル記号といった分数のようなものを記述するのにも利用されます.

The mfrac element is used for fractions. It can also be used to mark up fraction-like objects such as binomial coefficients and Legendre symbols.

<mfrac>要素が, block mathまたはinline mathに等しいdisplayプロパティの算出値を持たないならば, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. そうでなければ, 後で述べる配置が行われます.

If the <mfrac> element does not have its computed display property equal to block math or inline math then it is laid out according to the CSS specification where the corresponding value is described. Otherwise, the layout below is performed.

<mfrac>要素は, 2.1.3 共通の属性で述べられている属性と, 次の属性を持ちます.

The <mfrac> element accepts the attributes described in 2.1.3 Global Attributes as well as the following attribute:

linethickness属性は, 分数の線に対して使用される分数の線の太さを示します. もし存在するなら, この属性は, 有効な<length-percentage>(訳注:長さや百分率)である値を持たなければなりません. その属性が存在しないか無効な値の場合, FractionRuleThicknessが既定値として使用されます. 百分率は, 既定値に対するものとして解釈されます. 負の値は, 0として解釈されます.

The linethickness attribute indicates the fraction line thickness to use for the fraction bar. If present, it must have a value that is a valid <length-percentage>. If the attribute is absent or has an invalid value, FractionRuleThickness is used as the default value. A percentage is interpreted relative to that default value. A negative value is interpreted as 0.

次の例は, 異なるlinethicknessの値を持つ4つの分数を含んでいます. 線は, いつでもプラス記号やマイナス記号の中心に揃えられます. 分子と分母は, 水平方向に中央揃えされます. displaystyleでない分数は, より小さい離隔とフォントサイズを使用します.

The following example contains four fractions with different linethickness values. The bars are always aligned with the middle of plus and minus signs. The numerator and denominator are horizontally centered. The fractions that are not in displaystyle use smaller gaps and font-size.

<math>
  <mn>0</mn>
  <mo>+</mo>
  <mfrac displaystyle="true">
    <mn>1</mn>
    <mn>2</mn>
  </mfrac>
  <mo></mo>
  <mfrac>
    <mn>1</mn>
    <mn>2</mn>
  </mfrac>
  <mo>+</mo>
  <mfrac linethickness="200%">
    <mn>1</mn>
    <mn>234</mn>
  </mfrac>
  <mo></mo>
  <mrow>
    <mo>(</mo>
    <mfrac linethickness="0">
      <mn>123</mn>
      <mn>4</mn>
    </mfrac>
    <mo>)</mo>
  </mrow>
</math>
mfrac example

<mfrac>要素は, displaystylefalseに設定するか, 既にfalseの場合は子要素のscriptlevelを1つ増加させるかします. この要素は, 2番目の子要素のmath-shiftcompactに設定します. 分数の線と他の隣接する部品(例えばマイナス記号または他の分数の線)との視覚的な混同を避けるために, 通常1ピクセルの間隔が要素の周囲に加えられます. ユーザーエージェントのスタイルシートは, 次の決まりを含まなければなりません.

The <mfrac> element sets displaystyle to false, or if it was already false increments scriptlevel by 1, within its children. It sets math-shift to compact within its second child. To avoid visual confusion between the fraction bar and another adjacent items (e.g. minus sign or another fraction's bar), a default 1-pixel space is added around the element. The user agent stylesheet must contain the following rules:

mfrac {
  padding-inline-start: 1px;
  padding-inline-end: 1px;
}
mfrac > * {
  math-depth: auto-add;
  math-style: compact;
}
mfrac > :nth-child(2) {
  math-shift: compact;
}

<mfrac>要素が2つより少ないか多いフロー内子要素を持っている場合, 配置アルゴリズムは, mrowと同じです. そうでない場合, 最初のフロー内子要素は分子と呼ばれ, 2番目のフロー内子要素は分母と呼ばれ, 配置アルゴリズムは後で説明されているとおりです.

If the <mfrac> element has less or more than two in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called numerator, the second in-flow child is called denominator and the layout algorithm is explained below.

注意
Note
実際のところ, <mfrac>要素は, 2つのフロー内子要素を持ちます, したがって, CSSの決まりは, 基本的にscriptlevel, displaystyle, math-shift分子分母に対して変更するよう働きます.
In practice, an <mfrac> element has two children that are in-flow. Hence the CSS rules basically perform scriptlevel, displaystyle and math-shift changes for the numerator and denominator.
3.3.2.1 線の太さが0でない分数
Fraction with nonzero line thickness

分数の線の太さが0でない場合, <mfrac>要素は, 12で示されたように配置されます. 分数の線は, <mfrac>要素のvisibilityvisibleの場合のみ描画されなければなりません. この場合, 分数の線は, <mfrac>要素のcolorで描画されなければなりません.

If the fraction line thickness is nonzero, the <mfrac> element is laid out as shown on Figure 12. The fraction bar must only be painted if the visibility of the <mfrac> element is visible. In that case, the fraction bar must be painted with the color of the <mfrac> element.

12 <mfrac>要素に対するボックスモデル
Figure 12 Box model for the <mfrac> element

分数の数学コンテンツの最小内容行内サイズ(または最大内容行内サイズ)は, 分子マージンボックス最小内容行内サイズ(または最大内容行内サイズ)と分母マージンボックス最小内容行内サイズ(または最大内容行内サイズ)の大きい方です.

The min-content inline size (respectively max-content inline size) of content is the maximum between the min-content inline size (respectively max-content inline size) of the numerator's margin box and the min-content inline size (respectively max-content inline size) of the denominator's margin box.

行内伸長サイズ制限またはブロック伸長サイズ制限がある場合, 分子も, 同じサイズ制限を伴って配置され, そうでない場合, 何らサイズ制限無しで配置されます. 分母は, いつでも何らサイズ制限無しに配置されます.

If there is an inline stretch size constraint or a block stretch size constraint then the numerator is also laid out with the same stretch size constraint, otherwise it is laid out without any stretch size constraint. The denominator is always laid out without any stretch size constraint.

分数の数学コンテンツの行内サイズは, 分子マージンボックス行内サイズ分母マージンボックス行内サイズの大きい方です.

The inline size of the math content is the maximum between the inline size of the numerator's margin box and the inline size of the denominator's margin box.

分子移動距離は, 次の中で最大のものです.

NumeratorShift is the maximum between:

分母移動距離は, 次の中で最大のものです.

DenominatorShift is the maximum between:

分数の数学コンテンツの行アセントは, 次の中で最大のものです.

The line-ascent of the math content is the maximum between:

分数の数学コンテンツの行ディセントは, 次の中で最大のものです.

The line-descent of the math content is the maximum between:

分子(または分母)の行内移動距離は, 分数の数学コンテンツの行内サイズの半分 − 分子マージンボックス(または分母マージンボックス)の行内サイズの半分です.

The inline offset of the numerator (respectively denominator) is half the inline size of the math content − half the inline size of the numerator's margin box (respectively denominator's margin box).

分子(または分母)の欧文ベースラインは, 全体の欧文ベースラインから分子移動距離(または分母移動距離)の大きさ分, 行上面(または行下面)の方へずらされます.

The alphabetic baseline of the numerator (respectively denominator) is shifted away from the alphabetic baseline by a distance of NumeratorShift (respectively DenominatorShift) towards the line-over (respectively line-under).

数学コンテンツボックスは, 内容ボックスの中で, お互いのブロック始端が揃えられるように, 左右の両端の真ん中がお互いに同じ場所になるように位置決めされます.

The math content box is placed within the content box so that their block-start edges are aligned and the middles of these edges are at the same position.

分数の線の行内サイズは, 分数の内容ボックス行内サイズで, その行内始端は, 内容ボックスのものに揃えられます. 分数の線の中心は, 数学コンテンツボックス欧文ベースラインから軸高さの大きさ分, 行上面の方へずらされます. 分数の線のブロックサイズは, 分数の線の太さです.

The inline size of the fraction bar is the inline size of the content box and its inline-start edge is the aligned with the one the content box. The center of the fraction bar is shifted away from the alphabetic baseline of the math content box by a distance of AxisHeight towards the line-over. Its block size is the fraction line thickness.

3.3.2.2 線の太さが0の分数
Fraction with zero line thickness

分数の線の太さが0の場合, 0でない場合とは異なり, <mfrac>要素は, 13に示されたように配置されます.

If the fraction line thickness is zero, the <mfrac> element is instead laid out as shown on Figure 13.

13 線の無い<mfrac>要素に対するボックスモデル
Figure 13 Box model for the <mfrac> element without bar

分数の数学コンテンツの最小内容行内サイズ, 最大内容行内サイズ, 行内サイズは, 3.3.2.1 線の太さが0でない分数と同じ方法で計算されます.

The min-content inline size, max-content inline size and inline size of the math content are calculated the same as in 3.3.2.1 Fraction with nonzero line thickness.

行内伸長サイズ制限またはブロック伸長サイズ制限がある場合, 分子も, 同じサイズ制限を伴って配置され, そうでない場合, 何らサイズ制限無しで配置されます. 分母は, いつでも何らサイズ制限無しに配置されます.

If there is an inline stretch size constraint or a block stretch size constraint then the numerator is also laid out with the same stretch size constraint and otherwise it is laid out without any stretch size constraint. The denominator is always laid out without any stretch size constraint.

math-stylecompactの場合, 上方移動距離下方移動距離は, それぞれStackTopShiftUpStackBottomShiftDownに設定されます. そうでなくmath-stylenormalの場合, それらは, それぞれStackTopDisplayStyleShiftUpStackBottomDisplayStyleShiftDownに設定されます.

If the math-style is compact then TopShift and BottomShift are respectively set to StackTopShiftUp and StackBottomShiftDown. Otherwise math-style is normal and they are respectively set to StackTopDisplayStyleShiftUp and StackBottomDisplayStyleShiftDown.

離隔は, (下方移動距離分母マージンボックス字面行アセント) + (上方移動距離分子マージンボックス字面行ディセント)であると定義されます. math-stylecompactなら, 最小離隔は, StackGapMinで, そうでなくmath-stylenormalならStackDisplayStyleGapMinです. Δ = 最小離隔離隔が正の場合, 上方移動距離下方移動距離は, それぞれΔ/2とΔ − Δ/2の分増やされます.

The Gap is defined to be (BottomShift − the ink line-ascent of the denominator's margin box) + (TopShift − the ink line-descent of the numerator's margin box). If math-style is compact then GapMin is StackGapMin, otherwise math-style is normal and it is StackDisplayStyleGapMin. If Δ = GapMinGap is positive then TopShift and BottomShift are respectively increased by Δ/2 and Δ − Δ/2.

分数の数学コンテンツの行アセントは, 次の中で最大のものです.

The line-ascent of the math content is the maximum between:

分数の数学コンテンツの行ディセントは, 次の中で最大のものです.

The line-descent of the math content is the maximum between:

分子分母行内移動距離は, § 3.3.2.1 線の太さが0でない分数と同じように計算されます.

The inline offsets of the numerator and denominator are calculated the same as in 3.3.2.1 Fraction with nonzero line thickness.

分子(または分母)の欧文ベースラインは, 全体の欧文ベースラインから上方移動距離(または − 下方移動距離) の大きさ分, 行上面(または行下面)の方へずらされます.

The alphabetic baseline of the numerator (respectively denominator) is shifted away from the alphabetic baseline by a distance of TopShift (respectively − BottomShift) towards the line-over (respectively line-under).

数学コンテンツボックスは, 内容ボックスの中で, お互いのブロック始端が揃えられるように, 左右の両端の真ん中がお互いに同じ場所になるように位置決めされます.

The math content box is placed within the content box so that their block-start edges are aligned and the middles of these edges are at the same position.

3.3.3 <msqrt>, <mroot>
Radicals <msqrt>, <mroot>

根要素は, 根号√と中身の上の線を伴う式を構成します. msqrt要素は平方根に使用され, mroot要素は, 例えば立方根といった指数付きの根を描くのに使用されます.

The radical elements construct an expression with a root symbol √ with a line over the content. The msqrt element is used for square roots, while the mroot element is used to draw radicals with indices, e.g. a cube root.

<msqrt>要素と<mroot>要素は, 2.1.3 共通の属性で述べられている属性を持ちます.

The <msqrt> and <mroot> elements accept the attributes described in 2.1.3 Global Attributes.

次の例は, msqrtを用いて書かれた平方根と, mrootを用いて書かれた立方根を含んでいます. msqrtは, 複数の子要素を持っており, 平方根は, それらの全てに適用されることに注意して下さい. mrootは, ちょうど2つの子要素を持っています. 根の指数である2番目の子要素(数字3)が, 1番目の子要素(平方根)に適用されます. また, これらの要素は, mrootの指数のフォントサイズのみ変更しますが, 指数は, 分数の分子や分母より小さく縮小されることに注意して下さい.

The following example contains a square root written with msqrt and a cube root written with mroot. Note that msqrt has several children and the square root applies to all of them. mroot has exactly two children: it is a root of index the second child (the number 3), applied to the first child (the square root). Also note these elements only change the font-size within the mroot index, but it is scaled down more than within the numerator and denumerator of the fraction.

<math>
  <mroot>
    <msqrt>
      <mfrac>
        <mn>1</mn>
        <mn>2</mn>
      </mfrac>
      <mo>+</mo>
      <mn>4</mn>
    </msqrt>
    <mn>3</mn>
  </mroot>
  <mo>+</mo>
  <mn>0</mn>
</math>
msqrt-mroot example

<msqrt>要素と<mroot>要素は, math-shiftcompactに設定します. <mroot>要素は, scriptlevelを2つ増加させるように設定し, 最初の子要素以外の全ての displaystyleを"false"に設定します. ユーザーエージェントのスタイルシートは, この挙動を実装するために, 次の決まりを含まなければなりません.

The <msqrt> and <mroot> elements sets math-shift to compact. The <mroot> element increments scriptlevel by 2, and sets displaystyle to "false" in all but its first child. The user agent stylesheet must contain the following rule in order to implement that behavior:

mroot > :not(:first-child) {
  math-depth: add(2);
  math-style: compact;
}
mroot, msqrt {
  math-shift: compact;
}

<msqrt>要素または<mroot>要素が, block mathまたはinline mathに等しいdisplayプロパティの算出値を持たないならば, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. そうでなければ, 後で述べる配置が行われます.

If the <msqrt> or <mroot> element do not have their computed display property equal to block math or inline math then they are laid out according to the CSS specification where the corresponding value is described. Otherwise, the layout below is performed.

<mroot>要素が, 2つより少ないか多いフロー内子要素を持っている場合, 配置アルゴリズムは, mrow要素と同じです. そうでない場合, 最初のフロー内要素はmrootの基となる式と呼ばれ, 2番目のフロー内子要素はmrootの指数と呼ばれ, 配置アルゴリズムは後で説明されているとおりです.

If the <mroot> has less or more than two in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called mroot base and the second in-flow child is called mroot index and its layout algorithm is explained below.

注意
Note
実際のところ, <mroot>要素は, 2つのフロー内子要素を持ちます. したがって, CSSの決まりは, 基本的にscriptleveldisplaystyleを指数に対して変更するよう働きます.
In practice, an <mroot> element has two children that are in-flow. Hence the CSS rules basically perform scriptlevel and displaystyle changes for the index.

<msqrt>要素は, msqrtの基となる式と呼ばれる名前無し<mrow>ボックスを生成します.

The <msqrt> element generates an anonymous <mrow> box called the msqrt base.

3.3.3.1 根号
Radical symbol

根号は, <msqrt>要素または<mroot>要素のvisibilityvisibleの場合のみ描画されなければなりません. その場合, 根号は, 要素のcolorで描画されなければなりません.

The radical symbol must only be painted if the visibility of the <msqrt> or <mroot> element is visible. In that case, the radical symbol must be painted with the color of that element.

根号の字形は文字 U+221A 平方根に対して得られる字形です.

The radical glyph is the glyph obtained for the character U+221A SQUARE ROOT.

根号の離隔は, math-stylecompactならRadicalVerticalGapで, math-stylenormalならRadicalDisplayStyleVerticalGapで与えられます.

The radical gap is given by RadicalVerticalGap if the math-style is compact and RadicalDisplayStyleVerticalGap if the math-style is normal.

伸長された根号の字形に対する目標となる大きさは, RadicalRuleThickness, 根号の離隔, 基となる式の字面の高さの合計です.

The radical target size for the stretchy radical glyph is the sum of RadicalRuleThickness, radical gap and the ink height of the base.

根号の字形に対するボックスの尺度根の描画は, 根号の字形に対する目標の大きさであるブロック次元伸長された字形を形作るアルゴリズムによって与えられます.

The box metrics of the radical glyph and painting of the surd are given by the algorithm to shape a stretchy glyph to block dimension the target size for the radical glyph.

3.3.3.2 平方根
Square root

<msqrt>要素は, 14で示されたように配置されます.

The <msqrt> element is laid out as shown on Figure 14.

14 <msqrt>要素に対するボックスモデル
Figure 14 Box model for the <msqrt> element

平方根の数学コンテンツの最小内容行内サイズ(または最大内容行内サイズ)は, 根号の字形に対するブロック軸に沿って伸長された字形の望ましい行内サイズと, msqrtの基となる式マージンボックス最小内容行内サイズ(または最大内容行内サイズ)との合計です.

The min-content inline size (respectively max-content inline size) of the math content is the sum of the preferred inline size of a glyph stretched along the block axis for the radical glyph and of the min-content inline size (respectively max-content inline size) of the msqrt base's margin box.

平方根の数学コンテンツの行内サイズは, 根号の字形に対するボックスの尺度における前側の幅と, msqrtの基となる式のマージンボックスの行内サイズとの合計です.

The inline size of the math content is the sum of the advance width of the box metrics of the radical glyph and of the inline size of the msqrt base's margin's box.

平方根の数学コンテンツの行アセントは, 次の中で最大のものです.

The line-ascent of the math content is the maximum between:

平方根の数学コンテンツの行ディセントは, 次の中で最大のものです.

The line-descent of the math content is the maximum between:

上側の線の行内サイズは, 基となる式のマージンボックスの行内サイズです. msqrtの基となる式と上側の線の行内移動距離は同じで, 根号の字形に対するボックスの尺度の幅にも等しいです.

The inline size of the overbar is the inline size of the msqrt base's margin's box. The inline offsets of the msqrt base and overbar are also the same and equal to the width of the box metrics of the radical glyph.

msqrtの基となる式欧文ベースラインは, 全体の欧文ベースラインに揃えられます. 上側の線のブロックサイズは, RadicalRuleThicknessです. その線の鉛直方向の中心は, 欧文ベースラインから行上面の方へ, 平方根の数学コンテンツの行アセントからRadicalExtraAscenderRadicalRuleThicknessの半分を引いた距離の分ずらされます.

The alphabetic baseline of the msqrt base is aligned with the alphabetic baseline. The block size of the overbar is RadicalRuleThickness. Its vertical center is shifted away from the alphabetic baseline by a distance towards the line-over equal to the line-ascent of the math content, minus the RadicalExtraAscender, minus half the RadicalRuleThickness.

最終的に, 次のように根の描画が行われます.

Finally, the painting of the surd is performed:

3.3.3.3 指数付きの根
Root with index

<mroot>要素は, 15で示されたように配置されます. 最初, mrootの指数は無視され, mrootの基となる式と根号の字形が, (緑で示された)マージンボックスBを生成するために, § 3.3.3.2 平方根と同じアルゴリズムを用いて14で示されたように配置されます.

The <mroot> element is laid out as shown on Figure 15. The mroot index is first ignored and the mroot base and radical glyph are laid out as shown on figure Figure 14 using the same algorithm as in 3.3.3.2 Square root in order to produce a margin box B (represented in green).

15 <mroot>要素に対するボックスモデル
Figure 15 Box model for the <mroot> element

指数付きの根の数学コンテンツの最小内容行内サイズ(または最大内容行内サイズ)は, max(0, RadicalKernBeforeDegree), mrootの指数マージンボックスにおけるmrootの指数最小内容行内サイズ(または最大内容行内サイズ), max( − Bの最小内容行内サイズ, RadicalKernAfterDegree)(またはmax( − Bの最大内容行内サイズ, RadicalKernAfterDegree)), Bの最小内容行内サイズ(または最大内容行内サイズ)の合計です.

The min-content inline size (respectively max-content inline size) of the math content is the sum of max(0, RadicalKernBeforeDegree), the mroot index's min-content inline size (respectively max-content inline size) of the mroot index's margin box, max(−min-content inline size, RadicalKernAfterDegree) (respectively max(−max-content inline size, RadicalKernAfterDegree)) and of the min-content inline size (respectively max-content inline size) of B.

同じ表し方を使うならば, 調整済RadicalKernBeforeDegree調整済RadicalKernAfterDegreeは, それぞれmax(0, RadicalKernBeforeDegree)とmax( − 指数のマージンボックス行内サイズ, RadicalKernAfterDegree)です.

Using the same clamping, AdjustedRadicalKernBeforeDegree and AdjustedRadicalKernAfterDegree are respectively defined as max(0, RadicalKernBeforeDegree) and is max(−inline size of the index's margin box, RadicalKernAfterDegree).

指数付きの根の数学コンテンツの行内サイズは, 調整済RadicalKernBeforeDegree, 指数のマージンボックス行内サイズ, 調整済RadicalKernAfterDegree, Bの行内サイズの合計です.

The inline size of the math content is the sum of AdjustedRadicalKernBeforeDegree, the inline size of the index's margin box, AdjustedRadicalKernAfterDegree and of the inline size of B.

指数付きの根の数学コンテンツの行アセントは, 次の中で最大のものです.

The line-ascent of the math content is the maximum between:

指数付きの根の数学コンテンツの行ディセントは, 次の中で最大のものです.

The line-descent of the math content is the maximum between:

指数の行内移動距離は, 調整済RadicalKernBeforeDegreeです. mrootの基となる式の行内移動距離は, 同じもの + 指数のマージンボックス行内サイズです.

The inline offset of the index is AdjustedRadicalKernBeforeDegree. The inline-offset of the mroot base is the same + the inline size of the index's margin box.

Bの欧文ベースラインは, 全体の欧文ベースラインに揃えられます. 指数の欧文ベースラインは, 行下面の境界から, RadicalDegreeBottomRaisePercent × Bのブロックサイズ + 指数のマージンボックス行ディセントの距離の分ずらされます.

The alphabetic baseline of B is aligned with the alphabetic baseline. The alphabetic baseline of the index is shifted away from the line-under edge by a distance of RadicalDegreeBottomRaisePercent × the block size of B + the line-descent of the index's margin box.

注意
Note
一般に, 根の指数における前方カーニングは正である一方, 後方カーニングは負です. このことは, 根の要素は行内始端に間隔を持ち, 根の指数は根本体に重なるであろうことを意味します.
In general, the kerning before the root index is positive while the kerning after it is negative, which means that the root element will have some inline-start space and that the root index will overlap the surd.

3.3.4 書式の変更 <mstyle>
Style Change <mstyle>

歴史的に, mstyle要素は, その中身の描画に影響を与える書式の変更を行うために導入されました.

Historically, the mstyle element was introduced to make style changes that affect the rendering of its contents.

<mstyle>要素は, § 2.1.3 共通の属性で述べられている属性を持ちます. この要素の配置アルゴリズムは, mrow要素のものと同じです.

The <mstyle> element accepts the attributes described in 2.1.3 Global Attributes. Its layout algorithm is the same as the mrow element.

注意
Note
<mstyle>は完全なMathMLとの互換性のための実装です. MathMLコアのみを対象とする著者は, 書式にCSSを利用することが推奨されます.
<mstyle> is implemented for compatibility with full MathML. Authors whose only target is MathML Core are encouraged to use CSS for styling.

次の例において, mstyleは, scriptleveldisplaystyleを設定するのに使用されています. この設定は, その子孫要素のフォントサイズと添え字の位置に個別に影響していることに注意して下さい. MathMLコアにおいては, 代わりに単にmrow要素を使用すればよいです.

In the following example, mstyle is used to set the scriptlevel and displaystyle. Observe this is respectively affecting the font-size and placement of subscripts of their descendants. In MathML Core, one could just have used mrow elements instead.

<math>
  <munder>
    <mo movablelimits="true">*</mo>
    <mi>A</mi>
  </munder>
  <mstyle scriptlevel="1">
    <mstyle displaystyle="true">
      <munder>
        <mo movablelimits="true">*</mo>
        <mi>B</mi>
      </munder>
      <munder>
        <mo movablelimits="true">*</mo>
        <mi>C</mi>
      </munder>
    </mstyle>
    <munder>
      <mo movablelimits="true">*</mo>
      <mi>D</mi>
    </munder>
  </mstyle>
</math>
mstyle example

3.3.5 エラーメッセージ <merror>
Error Message <merror>

merror要素は, その中身を”エラーメッセージ”として表示します. この要素の意図は, 他の形式の入力からMathMLを生成するプログラムに, 入力の構文エラーを報告する標準の方法を提供することです.

The merror element displays its contents as an ”error message”. The intent of this element is to provide a standard way for programs that generate MathML from other input to report syntax errors in their input.

次の例において,merrorは, 何らかのLaTeXのような入力に対する構文解析エラーを示すために使用されています.

In the following example, merror is used to indicate a parsing error for some LaTeX-like input:

<math>
  <mfrac>
    <merror>
      <mtext>Syntax error: \frac{1}</mtext>
    </merror>
    <mn>3</mn>
  </mfrac>
</math>
merror example

<merror>要素は, § 2.1.3 共通の属性で述べられている属性を持ちます. この要素の配置アルゴリズムは, mrow要素のものと同じです. ユーザーエージェントのスタイルシートは, エラーメッセージを視覚的に強調するために, 次の決まりを含まなければなりません.

The <merror> element accepts the attributes described in 2.1.3 Global Attributes. Its layout algorithm is the same as the mrow element. The user agent stylesheet must contain the following rule in order to visually highlight the error message:

merror {
  border: 1px solid red;
  background-color: lightYellow;
}

3.3.6 周囲の余白を調整する <mpadded>
Adjust Space Around Content <mpadded>

mpadded要素は, そのフロー内子要素の中身と同じものを, ただし, <mpadded>の属性に従ってその中身の大きさと相対的な位置を修正して描画します.

The mpadded element renders the same as its in-flow child content, but with the size and relative positioning point of its content modified according to <mpadded>’s attributes.

<mpadded>要素は, § 2.1.3 共通の属性で述べられている属性と, 次の属性を持ちます.

The <mpadded> element accepts the attributes described in 2.1.3 Global Attributes as well as the following attributes:

width, height, depth, lspace, voffsetは, もし存在するなら, 有効な<length-percentage>(訳注:長さや百分率)である値を持たなければなりません.

The width, height, depth, lspace and voffset if present, must have a value that is a valid <length-percentage>.

次の例において, mpaddedは, 分数の周りの間隔を調整するために使用されています(青い背景は, その範囲を視覚化するのに使用されています). 属性無しでは, この要素はmrowのようにふるまいますが, その属性は, ボックスの大きさ(幅, 高さ, 深さ)やボックスの中での分数の位置(左側の間隔, 鉛直移動距離)を指定することができます.

In the following example, mpadded is used to tweak spacing around a fraction (a blue background is used to visualize it). Without attributes, it behaves like an mrow but the attributes allow to specify the size of the box (width, height, depth) and position of the fraction within that box (lspace and voffset).

<math>
  <mrow>
    <mn>1</mn>
    <mpadded style="background: lightblue;">
      <mfrac>
        <mn>23456</mn>
        <mn>78</mn>
      </mfrac>
    </mpadded>
    <mn>9</mn>
  </mrow>
  <mo>+</mo>
  <mrow>
    <mn>1</mn>
    <mpadded lspace="2em" voffset="-1em" height="1em" depth="3em" width="7em"
             style="background: lightblue;">
      <mfrac>
        <mn>23456</mn>
        <mn>78</mn>
      </mfrac>
    </mpadded>
    <mn>9</mn>
  </mrow>
</math>
mpadded example
3.3.6.1 内部ボックスと所要のパラメータ
Inner box and requested parameters

mpadded要素は, 内部行内サイズ, 内部行アセント, 内部行ディセントと呼ばれるパラメータを持つ, mpaddedの内部ボックスと呼ばれる名前無し<mrow>ボックスを生成します.

The mpadded element generates an anonymous <mrow> box called the mpadded inner box with parameters called inner inline size, inner line-ascent and inner line-descent.

所要の<mpadded>のパラメータは, 次のように決められます.

The requested <mpadded> parameters are determined as follows:

  • 所要の幅は, widthプロパティの解決値です. width属性が存在し, 百分率でない有効な値の場合, その属性は, 要素のwidthプロパティをその属性値に対応する値に設定する表現の助言として使用されます.
    The requested width is the resolved value of the width property. If the width attribute is present, valid and not a percentage then that attribute is used as a presentational hint setting the element's width property to the corresponding value.
  • height属性が存在しないか, 無効な値か百分率の場合, 所要の高さは, 内部行アセントです. そうでない場合, 所要の高さは, 負の値を0に固定した, height属性の解決値です.
    If the height attribute is absent, invalid or a percentage then the requested height is the inner line-ascent. Otherwise the requested height is the resolved value of the height attribute, clamping negative values to 0.
  • depth属性が存在しないか, 無効な値か百分率の場合, 所要の深さは, 内部行アセントです. そうでない場合 所要の深さは, 負の値を0に固定した, depth属性の解決値です.
    If the depth attribute is absent, invalid or a percentage then the requested depth is the inner line-ascent. Otherwise the requested depth is the resolved value of the depth attribute, clamping negative values to 0.
  • lspace属性が存在しないか, 無効な値か百分率の場合, 所要の左側の間隔は0です. そうでない場合, 所要の左側の間隔は, 負の値を0に固定したlspace属性の解決値です.
    If the lspace attribute is absent, invalid or a percentage then the requested lspace is 0. Otherwise the requested lspace is the resolved value of the lspace attribute, clamping negative values to 0.
  • voffset属性が存在しないか, 無効な値か百分率の場合, 所要の鉛直移動距離は0です. そうでない場合, 所要の鉛直移動距離は, voffset属性の解決値です.
    If the voffset attribute is absent, invalid or a percentage then the requested voffset is 0. Otherwise the requested voffset is the resolved value of the voffset attribute.
    注意
    Note
    負のvoffsetの値は, 0に固定されません.
    Negative voffset values are not clamped to 0.
3.3.6.2 <mpadded>の配置
Layout of <mpadded>

<mpadded>要素が, block mathまたはinline mathに等しいdisplayプロパティの算出値を持たないならば, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. そうでなければ, 16に示されたように配置されます.

If the <mpadded> element does not have its computed display property equal to block math or inline math then it is laid out according to the CSS specification where the corresponding value is described. Otherwise, it is laid out as shown on Figure 16.

16 <mpadded>要素に対するボックスモデル
Figure 16 Box model for the <mpadded> element

要素の数学コンテンツの最小内容行内サイズ(または最大内容行内サイズ)は, 3.3.6.1 内部ボックスと所要のパラメータで計算された所要の幅ですが, mpaddedの内部ボックス最小内容行内サイズ(または最大内容行内サイズ)を "内部行内サイズ"の代わりに用いて計算されます.

The min-content inline size (respectively max-content inline size) of the math content is the requested width calculated in 3.3.6.1 Inner box and requested parameters but using the min-content inline size (respectively max-content inline size) of the mpadded inner box instead of the "inner inline size".

要素の数学コンテンツの行内サイズは, 3.3.6.1 内部ボックスと所要のパラメータで計算された所要の幅です.

The inline size of the math content is the requested width calculated in 3.3.6.1 Inner box and requested parameters.

要素の数学コンテンツの行アセントは, 所要の高さです. 数学コンテンツの行ディセントは, 所要の深さです.

The line-ascent of the math content is the requested height. The line-descent of the math content is the requested depth.

mpaddedの内部ボックスは, その欧文ベースラインが, 全体の欧文ベースラインから所要の鉛直移動距離の分, 行上面の方へずらされるように配置されます.

The mpadded inner box is placed so that its alphabetic baseline is shifted away from the alphabetic baseline by the requested voffset towards the line-over.

3.3.7 見えない式をつくる <mphantom>
Making Sub-Expressions Invisible <mphantom>

歴史的に, mphantom要素は, その中身を見えないように, ただし, その中身が通常通り描画された場合と同じように, 欧文ベースラインの位置も含めて同じ尺度や次元で描画するために導入されました.

Historically, the mphantom element was introduced to render its content invisibly, but with the same metrics size and other dimensions, including alphabetic baseline position that its contents would have if they were rendered normally.

次の例において, mphantomは, 分数の分子と分母の対応する部分を揃えることを確かなものにするために使用されています.

In the following example, mphantom is used to ensure alignment of corresponding parts of the numerator and denominator of a fraction:

<math>
  <mfrac>
    <mrow>
      <mi>x</mi>
      <mo>+</mo>
      <mi>y</mi>
      <mo>+</mo>
      <mi>z</mi>
    </mrow>
    <mrow>
      <mi>x</mi>
      <mphantom>
        <mo form="infix">+</mo>
        <mi>y</mi>
      </mphantom>
      <mo>+</mo>
      <mi>z</mi>
    </mrow>
  </mfrac>
</math>
mphantom example

<mphantom>要素は, 2.1.3 共通の属性で述べられている属性を持ちます. この要素の配置アルゴリズムは, mrow要素のものと同じです. ユーザーエージェントのスタイルシートは, 要素の中身を隠すために, 次の決まりを含まなければなりません.

The <mphantom> element accepts the attributes described in 2.1.3 Global Attributes. Its layout algorithm is the same as the mrow element. The user agent stylesheet must contain the following rule in order to hide the content:

mphantom {
  visibility: hidden;
}
注意
Note
<mphantom>は完全なMathMLとの互換性のための実装です. MathMLコアのみを対象とする著者は, 書式にCSSを利用することが推奨されます.
<mphantom> is implemented for compatibility with full MathML. Authors whose only target is MathML Core are encouraged to use CSS for styling.

3.4 添え字の配置要素
Script and Limit Schemata

この節で説明する要素は, 基となる式の周りで1つ以上の添え字の位置を定めます. 様々な種類の添え字や装飾を記号に付け加えることは, 数学ではとても一般的な表記方法です. 純粋な視覚的な配置においては, 与えられた基となる式の周りに何らかの伝統的な添え字を配置する場合, 単独の一般的な目的の要素で添え字や装飾の位置を十分に定められます. しかしながら, 一般的な表記の抽象的な構造をより良く表現するために, MathMLは様々なより特別な添え字の要素を提供しています.

The elements described in this section position one or more scripts around a base. Attaching various kinds of scripts and embellishments to symbols is a very common notational device in mathematics. For purely visual layout, a single general-purpose element could suffice for positioning scripts and embellishments in any of the traditional script locations around a given base. However, in order to capture the abstract structure of common notation better, MathML provides several more specialized scripting elements.

下付きや上付きの添え字の要素に加えて, MathMLは, 基となる式の上や下に添え字を配置する上側の添え字や下側の添え字の要素を持っています. これらの要素は大きな演算子に添え字を配置したり, 元の式の上や下にアクセントや線を配置するのに利用できます.

In addition to sub-/superscript elements, MathML has overscript and underscript elements that place scripts above and below the base. These elements can be used to place limits on large operators, or for placing accents and lines above or below the base.

3.4.1 下付きや上付きの添え字 <msub>, <msup>, <msubsup>
Subscripts and Superscripts <msub>, <msup>, <msubsup>

msub要素, msup要素, msubsup要素は, MathMLの式に下付き添え字や上付き添え字を付け加えるのに使用されます. これらの要素は, 2.1.3 共通の属性で述べられている属性を持ちます.

The msub, msup and msubsup elements are used to attach subscript and superscript to a MathML expression. They accept the attributes described in 2.1.3 Global Attributes.

次の例は, 下付き添え字や上付き添え字の基本的な使い方を示しています. フォントサイズは, 添え字では自動的に縮小されます.

The following example shows basic use of subscripts and superscripts. The font-size is automatically scaled down within the scripts.

<math>
  <msub>
    <mn>1</mn>
    <mn>2</mn>
  </msub>
  <mo>+</mo>
  <msup>
    <mn>3</mn>
    <mn>4</mn>
  </msup>
  <mo>+</mo>
  <msubsup>
    <mn>5</mn>
    <mn>6</mn>
    <mn>7</mn>
  </msubsup>
</math>
msub-msup-msubsup example

<msub>要素, <msup>要素, <msubsup>要素が, block mathまたはinline mathに等しいdisplayプロパティの算出値を持たないならば, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. そうでなければ, 後で述べる配置が行われます.

If the <msub>, <msup> or <msubsup> elements do not have their computed display property equal to block math or inline math then they are laid out according to the CSS specification where the corresponding value is described. Otherwise, the layout below is performed.

3.4.1.1 <msub>, <msup>, <msubsup>の子要素
Children of <msub>, <msup>, <msubsup>

<msub>要素が, 2つより少ないか多いフロー内子要素を持っている場合, 配置アルゴリズムは, mrow要素と同じです. そうでない場合, 最初のフロー内子要素はmsubの基となる式, 2番目のフロー内子要素はmsubの下付き添え字と呼ばれ, 配置アルゴリズムは3.4.1.2 下付き添え字と式で説明されているとおりです.

If the <msub> element has less or more than two in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called the msub base, the second in-flow child is called the msub subscript and the layout algorithm is explained in 3.4.1.2 Base with subscript.

<msup>要素が, 2つより少ないか多い フロー内子要素を持っている場合, 配置アルゴリズムは, mrow要素と同じです. そうでない場合, 最初のフロー内子要素はmsupの基となる式, 2番目のフロー内子要素はmsupの上付き添え字と呼ばれ, 配置アルゴリズムは3.4.1.3 上付き添え字と式で説明されているとおりです.

If the <msup> element has less or more than two in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called the msup base, the second in-flow child is called the msup superscript and the layout algorithm is explained in 3.4.1.3 Base with superscript.

<msubsup>要素が, 3つより少ないか多いフロー内子要素を持っている場合, 配置アルゴリズムは, mrow要素と同じです. そうでない場合, 最初のフロー内子要素はmsubsupの基となる式, 2番目のフロー内子要素はmsubsupの下付き添え字, 3番目のフロー内子要素はmsubsupの上付き添え字と呼ばれ, 配置アルゴリズムは3.4.1.4 上付き・下付き添え字と式で説明されているとおりです.

If the <msubsup> element has less or more than three in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called the msubsup base, the second in-flow child is called the msubsup subscript, its third in-flow child is called the msubsup superscript and the layout algorithm is explained in 3.4.1.4 Base with subscript and superscript.

3.4.1.2 下付き添え字と式
Base with subscript

<msub>要素は, 17で示されたように配置されます. 大きな演算子のイタリック補正は, msubの基となる式largeopプロパティを持つ修飾された演算子ならその式のイタリック補正, そうでなければ0です.

The <msub> element is laid out as shown on Figure 17. LargeOpItalicCorrection is the italic correction of the msub base if it is an embellished operator with the largeop property and 0 otherwise.

17 <msub>要素に対するボックスモデル
Figure 17 Box model for the <msub> element

添え字付きの式の数学コンテンツの最小内容行内サイズ(または最大内容行内サイズ)は, msubの基となる式マージンボックス最初内容行内サイズ(または最大内容行内サイズ) − 大きな演算子のイタリック補正 + msubの下付き添え字マージンボックス最小内容行内サイズ(または最大内容行内サイズ) + SpaceAfterScriptです.

The min-content inline size (respectively max-content inline size) of the math content is the min-content inline size (respectively max-content inline size) of the msub base's margin boxLargeOpItalicCorrection + min-content inline size (respectively max-content inline size) of the msub subscript's margin box + SpaceAfterScript.

行内伸長サイズ制限またはブロック伸長サイズ制限がある場合, msubの基となる式も同じサイズ制限を伴って配置され, そうでない場合, 何らサイズ制限無しで配置されます. 添え字は, いつでも何らサイズ制限無しに配置されます.

If there is an inline stretch size constraint or a block stretch size constraint then the msub base is also laid out with the same stretch size constraint and otherwise it is laid out without any stretch size constraint. The scripts are always laid out without any stretch size constraint.

添え字付きの式の数学コンテンツの行内サイズは, msubの基となる式マージンボックスの行内サイズ − 大きな演算子のイタリック補正 + msubの下付き添え字マージンボックス行内サイズ + SpaceAfterScriptです.

The inline size of the math content is the inline size of the msub base's margin boxLargeOpItalicCorrection + the inline size of the msub subscript's margin box + SpaceAfterScript.

下付き添え字移動距離は, 次の中で最大のものです.

SubShift is the maximum between:

添え字付きの式の数学コンテンツの行アセントは, 次の中で最大のものです.

The line-ascent of the math content is the maximum between:

添え字付きの式の数学コンテンツの行ディセントは, 次の中で最大のものです.

The line-descent of the math content is the maximum between:

msubの基となる式行内移動距離は0で, msubの下付き添え字行内移動距離は, msubの基となる式マージンボックス行内サイズ大きな演算子のイタリック補正です.

The inline offset of the msub base is 0 and the inline offset of the msub subscript is the inline size of the msub base's margin boxLargeOpItalicCorrection.

msubの基となる式は, その欧文ベースラインが全体の欧文ベースラインに一致するように配置されます. msubの下付き添え字は, その欧文ベースラインが, 全体の欧文ベースラインから下付き添え字移動距離の分, 行下面の方へずらされるように配置されます.

The msub base is placed so that its alphabetic baseline matches the alphabetic baseline. The msub subscript is placed so that its alphabetic baseline is shifted away from the alphabetic baseline by SubShift towards the line-under.

3.4.1.3 上付き添え字と式
Base with superscript

<msup>要素は, 18で示されたように配置されます. イタリック補正は, msupの基となる式largeopプロパティを持つ修飾された演算子でないならその式のイタリック補正, そうでなければ0です.

The <msup> element is laid out as shown on Figure 18. ItalicCorrection is the italic correction of the msup base if it is not an embellished operator with the largeop property and 0 otherwise.

18 <msup>要素に対するボックスモデル
Figure 18 Box model for the <msup> element

添え字付きの式の数学コンテンツの最小内容行内サイズ(または最大内容行内サイズ)は, msupの基となる式マージンボックス最小内容行内サイズ(または最大内容行内サイズ) + イタリック補正 + msupの上付き添え字マージンボックス最小内容行内サイズ(または最大内容行内サイズ) + SpaceAfterScriptです.

The min-content inline size (respectively max-content inline size) of the math content is the min-content inline size (respectively max-content inline size) of the msup base's margin box + ItalicCorrection + the min-content inline size (respectively max-content inline size) of the msup superscript's margin box + SpaceAfterScript.

行内伸長サイズ制限またはブロック伸長サイズ制限がある場合, msupの基となる式も同じサイズ制限を伴って配置され, そうでない場合, 何らサイズ制限無しで配置されます. 添え字は, いつでも何らサイズ制限無しに配置されます.

If there is an inline stretch size constraint or a block stretch size constraint then the msup base is also laid out with the same stretch size constraint and otherwise it is laid out without any stretch size constraint. The scripts are always laid out without any stretch size constraint.

添え字付きの式の数学コンテンツの行内サイズは, msupの基となる式マージンボックス行内サイズ + イタリック補正 + msupの上付き添え字マージンボックス行内サイズ + SpaceAfterScriptです.

The inline size of the math content is the inline size of the msup base's margin box + ItalicCorrection + the inline size of the msup superscript's margin box + SpaceAfterScript.

上付き添え字移動距離は, 次の中で最大のものです.

SuperShift is the maximum between:

添え字付きの式の数学コンテンツの行アセントは, 次の中で最大のものです.

The line-ascent of the math content is the maximum between:

添え字付きの式の数学コンテンツの行ディセントは, 次の中で最大のものです.

The line-descent of the math content is the maximum between:

msupの基となる式行内移動距離は0で, msupの下付き添え字行内移動距離は, msupの基となる式マージンボックス行内サイズ + イタリック補正です.

The inline offset of the msup base is 0 and the inline offset of msup superscript is the inline size of the msup base's margin box + ItalicCorrection.

msupの基となる式は, その欧文ベースラインが全体の欧文ベースラインに一致するように配置されます. msupの下付き添え字は, その欧文ベースラインが, 全体の欧文ベースラインから上付き添え字移動距離の分, 行上面の方へずらされるように配置されます.

The msup base is placed so that its alphabetic baseline matches the alphabetic baseline. The msup superscript is placed so that its alphabetic baseline is shifted away from the alphabetic baseline by SuperShift towards the line-over.

3.4.1.4 下付き・上付き添え字と式
Base with subscript and superscript

<msubsup>要素は, 18で示されたように配置されます. 大きな演算子のイタリック補正下付き添え字移動距離は, 3.4.1.2 下付き添え字と式と同じように設定されます. イタリック補正上付き添え字移動距離は, 3.4.1.3 上付き添え字と式と同じように設定されます.

The <msubsup> element is laid out as shown on Figure 18. LargeOpItalicCorrection and SubShift are set as in 3.4.1.2 Base with subscript. ItalicCorrection and SuperShift are set as in 3.4.1.3 Base with superscript.

19 <msubsup>要素に対するボックスモデル
Figure 19 Box model for the <msubsup> element

添え字付きの式の数学コンテンツの最小内容行内サイズ(または, 最大内容行内サイズ, 行内サイズ)は, 3.4.1.2 下付き添え字と式および3.4.1.3 上付き添え字と式で計算された数学コンテンツの最小内容サイズ(または, 最大内容サイズ, 行内サイズ)の中で最大のものです.

The min-content inline size (respectively max-content inline size and inline size) of the math content is the maximum between the min-content inline size (respectively max-content inline size and inline size) of the math content calculated in 3.4.1.2 Base with subscript and 3.4.1.3 Base with superscript.

行内伸長サイズ制限またはブロック伸長サイズ制限がある場合, msubsupの基となる式も同じサイズ制限を伴って配置され, そうでない場合, 何らサイズ制限無しで配置されます. 添え字は, いつでも何らサイズ制限無しに配置されます.

If there is an inline stretch size constraint or a block stretch size constraint then the msubsup base is also laid out with the same stretch size constraint and otherwise it is laid out without any stretch size constraint. The scripts are always laid out without any stretch size constraint.

行内伸長サイズ制限またはブロック伸長サイズ制限がある場合, msubsupの基となる式も同じサイズ制限を伴って配置され, そうでない場合, 何らサイズ制限無しで配置されます. 添え字は, いつでも何らサイズ制限無しに配置されます.

If there is an inline stretch size constraint or a block stretch size constraint then the msubsup base is also laid out with the same stretch size constraint and otherwise it is laid out without any stretch size constraint. The scripts are always laid out without any stretch size constraint.

下付き・上付き添え字離隔は, ブロック軸に沿った2つの添え字の離隔で, (下付き添え字移動距離msubsupの下付き添え字マージンボックス字面行アセント) + (上付き添え字移動距離msubsupの上付き添え字マージンボックス字面行ディセント)と定義されます. 下付き・上付き添え字離隔SubSuperscriptGapMinより小さい場合, この条件が有効であることが確かになるように, 次の工程が実行されます.

SubSuperGap is the gap between the two scripts along the block axis and is defined by (SubShift − the ink line-ascent of the msubsup subscript's margin box) + (SuperShift − the ink line-descent of the msubsup superscript's margin box). If SubSuperGap is not at least SubSuperscriptGapMin then the following steps are performed to ensure that the condition holds:

  1. ΔをSuperscriptBottomMaxWithSubscript − (上付き添え字移動距離msubsupの上付き添え字マージンボックス字面行ディセント)に設定します. Δ > 0なら, Δ, またはSubSuperscriptGapMin下付き・上付き添え字離隔の小さい方にΔを設定し, Δの分, 上付き添え字移動距離を(, また, 同じように下付き・上付き添え字離隔も)増加させます.
    Let Δ be SuperscriptBottomMaxWithSubscript − (SuperShift − the ink line-descent of the msubsup superscript's margin box). If Δ > 0 then set Δ to the minimum between Δ set SubSuperscriptGapMinSubSuperGap and increase SuperShift (and so SubSuperGap too) by Δ.
  2. ΔをSubSuperscriptGapMin下付き・上付き添え字離隔に設定します. Δ > 0なら, Δの分, 下付き添え字移動距離を(, また, 同じように下付き・上付き添え字離隔も)増加させます.
    Let Δ be SubSuperscriptGapMinSubSuperGap. If Δ > 0 then increase SubscriptShift (and so SubSuperGap too) by Δ.

添え字付きの式の数学コンテンツの字面行アセント(または, 行アセント, 字面行ディセント, 行ディセント)は, 3.4.1.2 下付き添え字と式および3.4.1.3 上付き添え字と式で計算された, ただし, 上記で調整された下付き添え字移動距離上付き添え字移動距離を用いて計算された数学コンテンツの, 字面行アセント(または, 行アセント, 字面行ディセント, 行ディセント)の中で最大のものです.

The ink line-ascent (respectively line-ascent, ink line-descent, line-descent) of the math content is set to the maximum of the ink line-ascent (respectively line-ascent, ink line-descent, line-descent) of the math content calculated in 3.4.1.2 Base with subscript and 3.4.1.3 Base with superscript but using the adjusted values SubShift and SuperShift above.

msubsupの基となる式と添え字の行内移動距離ブロック移動距離は, 3.4.1.2 下付き添え字と式および3.4.1.3 上付き添え字と式で述べられているのと同じように計算されます.

The inline offset and block offset of the msubsup base and scripts are performed the same as described in 3.4.1.2 Base with subscript and 3.4.1.3 Base with superscript.

注意
Note

msubsupの下付き添え字(または, msubsupの上付き添え字)が空のボックスだとしても, 下付き・上付き離隔における追加の制限のために, <msubsup>は, 一般に, 3.4.1.3 上付き添え字と式(または, 3.4.1.2 下付き添え字と式)と同じように描画されることはありません. さらに, 空のmsubsupの下付き添え字(または, msubsupの上付き添え字)を配置することは, 全体の大きさを変更することにもなるかもしれません.

Even when the msubsup subscript (respectively msubsup superscript) is an empty box, <msubsup> does not generally render the same as 3.4.1.3 Base with superscript (respectively 3.4.1.2 Base with subscript) because of the additional constraint on SubSuperGap. Moreover, positioning the empty msubsup subscript (respectively msubsup superscript) may also change the total size.

アルゴリズムを単純に保つために, 空の添え字を特別な方法で取り扱う試みは, 何ら行われていません.

In order to keep the algorithm simple, no attempt is made to handle empty scripts in a special way.

3.4.2 下側や上側の添え字 <munder>, <mover>, <munderover>
Underscripts and Overscripts <munder>, <mover>, <munderover>

munder要素, mover要素, munderover要素は, MathMLの式の下側や上側に配置されるアクセントや極限を付け加えるのに使用されます.

The munder, mover and munderover elements are used to attach accents or limits placed under or over a MathML expression.

<munderover>要素は, 2.1.3 共通の属性で述べられている属性と次の属性を持ちます.

The <munderover> element accepts the attribute described in 2.1.3 Global Attributes as well as the following attributes:

同様に, <mover>要素(または, <munder>要素)は, 2.1.3 共通の属性で述べられている属性とaccent属性(または, accentunder属性)を持ちます.

Similarly, the <mover> element (respectively <munder> element) accepts the attribute described in 2.1.3 Global Attributes as well as the accent attribute (respectively the accentunder attribute).

accent属性, accentunder属性は, もし存在するなら, ブール値である値を持たなければなりません. それらの値が省略されたか無効な値である場合, falseに等しいものとして扱われます. ユーザーエージェントは, 3.4.4 添え字におけるdisplaystyle, scriptlevel, math-shiftで述べられているように実装しなければなりません.

accent, accentunder attributes, if present, must have values that are booleans. If these attributes are absent or invalid, they are treated as equal to false. User agents must implement them as described in 3.4.4 Displaystyle, scriptlevel and math-shift in scripts.

次の例は, 下側や上側の添え字の基本的な使用方法を示しています. フォントサイズは, 添え字がアクセントを意味しない限り, 自動的に縮小されます.

The following example shows basic use of under- and overscripts. The font-size is automatically scaled down within the scripts, unless they are meant to be accents.

<math>
  <munder>
    <mn>1</mn>
    <mn>2</mn>
  </munder>
  <mo>+</mo>
  <mover>
    <mn>3</mn>
    <mn>4</mn>
  </mover>
  <mo>+</mo>
  <munderover>
    <mn>5</mn>
    <mn>6</mn>
    <mn>7</mn>
  </munderover>
  <mo>+</mo>
  <munderover accent="true">
    <mn>8</mn>
    <mn>9</mn>
    <mn>10</mn>
  </munderover>
  <mo>+</mo>
  <munderover accentunder="true">
    <mn>11</mn>
    <mn>12</mn>
    <mn>13</mn>
  </munderover>
</math>
munder-over-munderover example

<munder>要素, <mover>要素, <munderover>要素が, block mathまたはinline mathに等しいdisplayプロパティの算出値を持たないならば, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. そうでなければ, 後で述べる配置が行われます.

If the <munder>, <mover> or <munderover> elements do not have their computed display property equal to block math or inline math then they are laid out according to the CSS specification where the corresponding value is described. Otherwise, the layout below is performed.

3.4.2.1 <munder>, <mover>, <munderover>の子要素
Children of <munder>, <mover>, <munderover>

<munder>要素が, 2つより少ないか多いフロー内子要素を持っている場合, 配置アルゴリズムは, mrow要素と同じです. そうでない場合, 最初のフロー内子要素はmunderの基となる式, 2番目のフロー内子要素はmunderの下側添え字と呼ばれます.

If the <munder> element has less or more than two in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called the munder base and the second in-flow child is called the munder underscript.

<mover>要素が, 2つより少ないか多いフロー内子要素を持っている場合, 配置アルゴリズムは, mrow要素と同じです. そうでない場合, 最初のフロー内子要素はmoverの基となる式, 2番目のフロー内子要素はmoverの上側添え字と呼ばれます.

If the <mover> element has less or more than two in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called the mover base and the second in-flow child is called the mover overscript.

<munderover>要素が, 3つより少ないか多いフロー内子要素を持っている場合, 配置アルゴリズムは, mrow要素と同じです. そうでない場合, 最初のフロー内子要素はmunderoverの基となる式, 2番目のフロー内子要素はmunderoverの下側添え字, 3番目のフロー内子要素はmunderoverの上側添え字と呼ばれます.

If the <munderover> element has less or more than three in-flow children, its layout algorithm is the same as the mrow element. Otherwise, the first in-flow child is called the munderover base, the second in-flow child is called the munderover underscript and its third in-flow child is called the munderover overscript.

<munder>要素, <mover>要素, <munderover>要素が, compactに等しいmath-styleプロパティの算出値を持っていて, movablelimitsプロパティを持つ装飾された演算子なら, それらの配置アルゴリズムは, 3.4.1.2 下付き添え字と式, 3.4.1.3 上付き添え字と式, 3.4.1.4 下付き・上付き添え字と式<msub>, <msup>, <msubsup>について述べた, それぞれのアルゴリズムと同じです.

If the <munder>, <mover> or <munderover> elements have a computed math-style property equal to compact and their base is an embellished operator with the movablelimits property, then their layout algorithms are respectively the same as the ones described for <msub>, <msup> and <msubsup> in 3.4.1.2 Base with subscript, 3.4.1.3 Base with superscript and 3.4.1.4 Base with subscript and superscript.

そうでない場合の<munder>, <mover>, <munderover>の配置アルゴリズムは, 3.4.2.3 下側添え字と式, 3.4.2.4 上側添え字と式, 3.4.2.5 下側・上側添え字と式でそれぞれ説明しています.

Otherwise, the <munder>, <mover> and <munderover> layout algorithms are respectively described in 3.4.2.3 Base with underscript, 3.4.2.4 Base with overscript and 3.4.2.5 Base with underscript and overscript.

3.4.2.2 行内軸に沿って演算子を伸長するアルゴリズム
Algorithm for stretching operators along the inline axis

行内軸に沿って演算子を伸長するアルゴリズムは次のとおりです.

The algorithm for stretching operators along the inline axis is as follows.

  1. 行内伸長サイズ制限またはブロック伸長サイズ制限があるなら, 配置される要素は, 装飾された演算子です. 基となる式を同じ伸長サイズ制限を伴って配置します.
    If there is an inline stretch size constraint or block stretch size constraint then the element being laid out is an embellished operator. Lay out the base with the same stretch size constraint.
  2. まだ配置されていないフロー内子要素の一覧を, stretchyプロパティと行内伸長軸を持つ装飾された演算子を含む最初の一覧LToStretchと2番目の一覧LNotToStretchに分割します.
    Split the list of in-flow children that have not been laid out yet into a first list LToStretch containing embellished operators with a stretchy property and inline stretch axis; and a second list LNotToStretch.
  3. LNotToStretchの全ての部分について, 何ら伸長サイズ制限無しに配置を実施します. もし, LToStretchが空なら停止します. LNotToStretchが空なら, LToStretchの全ての部分において, 伸長サイズ制限を0として配置を実施します.
    Perform layout without any stretch size constraint on all the items of LNotToStretch. If LToStretch is empty then stop. If LNotToStretch is empty, perform layout with stretch size constraint 0 on all the items of LToStretch.
  4. 目標のサイズTを, 前の工程で配置された子要素ボックスのマージンボックス行内サイズの最大値に設定します.
    Calculate the target size T to the maximum inline size of the margin boxes of child boxes that have been laid out in the previous step.
  5. LToStretchの全ての要素を行内伸長サイズ制限 Tを伴って配置または再配置します.
    Lay out or relayout all the elements of LToStretch with inline stretch size constraint T.
3.4.2.3 下側添え字と式
Base with underscript

<munder>要素は, 20で示されたように配置されます. 大きな演算子のイタリック補正は, munderの基となる式largeopプロパティを持つ修飾された演算子ならその式のイタリック補正, そうでなければ0です.

The <munder> element is laid out as shown on Figure 20. LargeOpItalicCorrection is the italic correction of the munder base if it is an embellished operator with the largeop property and 0 otherwise.

20 <munder>要素に対するボックスモデル
Figure 20 Box model for the <munder> element

添え字付きの式の数学コンテンツの最小内容行内サイズ(または, 最大内容行内サイズ)は, 後で述べる数学コンテンツの行内サイズと同じように, ただし, munderの基となる式マージンボックスmunderの下側添え字マージンボックスにおける行内サイズを, munderの基となる式マージンボックスmunderの下側添え字マージンボックスにおける最小内容行内サイズ(または, 最大内容行内サイズ)に置き換えて算出されます.

The min-content inline size (respectively max-content inline size) of the math content are calculated like the inline size of the math content below but replacing the inline sizes of the munder base's margin box and munder underscript's margin box with the min-content inline size (respectively max-content inline size) of the munder base's margin box and munder underscript's margin box.

フロー内子要素は, 行内軸に沿って演算子を伸長するアルゴリズムを使用して配置されます.

The in-flow children are laid out using the algorithm for stretching operators along the inline axis.

添え字付きの式の数学コンテンツの行内サイズは, 次の2つの数値の差の絶対値を求めることで算出されます.

The inline size of the math content is calculated by determining the absolute difference between:

mが上の2番目で算出された最小値とすると, munderの基となる式行内移動距離は, − m − 基となる式のマージンボックス行内サイズの半分です. munderの下側添え字行内移動距離は, − m − munderの下側添え字マージンボックス行内サイズの半分 − 大きな演算子のイタリック補正の半分です.

If m is the minimum calculated in the second item above then the inline offset of the munder base is −m − half the inline size of the base's margin box. The inline offset of the munder underscript is −m − half the inline size of the munder underscript's margin box − half LargeOpItalicCorrection.

下側添え字移動距離下側添え字追加ディセントのパラメータは, 次の順番で3つの状態を考慮して決められます.

Parameters UnderShift and UnderExtraDescender are determined by considering three cases in the following order:

  1. munderと基となる式が, largeopプロパティを持つ装飾された演算子の場合. 下側添え字移動距離は, 次の中で最大のものです.

    The munder base is an embellished operator with the largeop property. UnderShift is the maximum of

    下側添え字追加ディセントは0です.

    UnderExtraDescender is 0.

  2. munderの基となる式が, stretchyプロパティを持ち, 伸長軸が行内軸の装飾された演算子の場合. 下側添え字移動距離は, 次の中で最大のものです.

    The munder base is an embellished operator with the stretchy property and stretch axis inline. UnderShift is the maximum of:

    下側添え字追加ディセントは0です.
    UnderExtraDescender is 0.
  3. それら以外の場合, 下側添え字移動距離は, accentunder属性が大文字・小文字を区別せずにtrueに一致するならUnderbarVerticalGapで, そうでなければ0です. 下側添え字追加ディセントUnderbarExtraDescenderです.
    Otherwise, UnderShift is equal to UnderbarVerticalGap if the accentunder attribute is not an ASCII case-insensitive match to true and to zero otherwise. UnderExtraAscender is UnderbarExtraDescender.

添え字付きの式の数学コンテンツの行アセントは, 次の中で最大のものです.

The line-ascent of the math content is the maximum between:

添え字付きの式の数学コンテンツの行ディセントは, 次の中で最大のものです.

The line-descent of the math content is the maximum between:

munderの基となる式欧文ベースラインは, 全体の欧文ベースラインに揃えられます. munderの下側添え字欧文ベースラインは, 全体の欧文ベースラインから, munderの基となる式マージンボックス字面行ディセント + 下側添え字移動距離の分, 行下面の方へずらされます.

The alphabetic baseline of the munder base is aligned with the alphabetic baseline. The alphabetic baseline of the munder underscript is shifted away from the alphabetic baseline and towards the line-under by a distance equal to the ink line-descent of the munder base's margin box + UnderShift.

数学コンテンツボックスは, 内容ボックスの中で, お互いのブロック始端が揃えられるように, 左右の両端の真ん中がお互いに同じ場所になるように位置決めされます.

The math content box is placed within the content box so that their block-start edges are aligned and the middles of these edges are at the same position.

3.4.2.4 上側添え字と式
Base with overscript

<mover>要素は, 21で示されたように配置されます. 大きな演算子のイタリック補正は, moverの基となる式largeopプロパティを持つ修飾された演算子ならその式のイタリック補正, そうでなければ0です.

The <mover> element is laid out as shown on Figure 21. LargeOpItalicCorrection is the italic correction of the mover base if it is an embellished operator with the largeop property and 0 otherwise.

21 <mover>要素に対するボックスモデル
Figure 21 Box model for the <mover> element

添え字付きの式の数学コンテンツの最小内容行内サイズ(または, 最大内容行内サイズ)は, 後で述べる数学コンテンツの行内サイズと同じように, ただし, moverの基となる式マージンボックスmoverの上側添え字マージンボックスにおける行内サイズを, moverの基となる式マージンボックスmover の上側添え字マージンボックスにおける最小内容行内サイズ(または, 最大内容行内サイズ)に置き換えて算出されます.

The min-content inline size (respectively max-content inline size) of the math content are calculated like the inline size of the math content below but replacing the inline sizes of the mover base's margin box and mover overscript's margin box with the min-content inline size (respectively max-content inline size) of the mover base's margin box and mover overscript's margin box.

フロー内子要素は, 行内軸に沿って演算子を伸長するアルゴリズムを使用して配置されます.

The in-flow children are laid out using the algorithm for stretching operators along the inline axis.

上側アクセント付随位置は, moverの上側添え字上側アクセント付随位置, もしくは, もしその値が定義されていなければ, moverの上側添え字マージンボックス行内サイズの半分です.

The TopAccentAttachment is the top accent attachment of the mover overscript or half the inline size of the mover overscript's margin box if it is undefined.

添え字付きの式の数学コンテンツの行内サイズは, 配置のために行内軸に沿って演算子を伸長するアルゴリズムを適用し, 次の2つの数値の差の絶対値を求めることで算出されます.

The inline size of the math content is calculated by applying the algorithm for stretching operators along the inline axis for layout and determining the absolute difference between:

mが上の2番目で算出された最小値とすると, moverの基となる式行内移動距離は, − m − 基となる式のマージンボックスの行内サイズの半分です. moverの上側添え字行内移動距離は, − m − moverの下側添え字マージンボックス行内サイズの半分 − 大きな演算子のイタリック補正の半分です.

If m is the minimum calculated in the second item above then the inline offset of the mover base is −m − half the inline size of the base's margin. The inline offset of the mover overscript is −m − half the inline size of the mover overscript's margin box + half LargeOpItalicCorrection.

上側添え字移動距離上側添え字追加ディセントのパラメータは, 次の順番で3つの状態を考慮して決められます.

Parameters OverShift and OverExtraDescender are determined by considering three cases in the following order:

  1. moverの基となる式が, largeopプロパティを持つ装飾された演算子の場合. 上側添え字移動距離は次の中で最大のものです.

    The mover base is an embellished operator with the largeop property. OverShift is the maximum of

    上側添え字追加アセントは0です.

    OverExtraAscender is 0.

  2. moverの基となる式が, stretchyプロパティを持ち, 伸長軸が行内軸の装飾された演算子の場合. 上側添え字移動距離は次の中で最大のものです.

    The mover base is an embellished operator with the stretchy property and stretch axis inline. OverShift is the maximum of:

    上側添え字追加アセントは0です.
    OverExtraDescender is 0.
  3. そうでない場合, 上側添え字移動距離は, 次のものに等しいです.

    Otherwise, OverShift is equal to

    1. accent属性が大文字・小文字を区別せずにtrueに一致しないなら, OverbarVerticalGap.
      OverbarVerticalGap if the accent attribute is not an ASCII case-insensitive match to true.
    2. AccentBaseHeight引くmoverの基となる式マージンボックス行アセントが負でないなら, この差.
      Or AccentBaseHeight minus the line-ascent of the mover base's margin box if this difference is nonnegative.
    3. また, いずれでもないなら, 0.
      Or 0 otherwise.

    上側添え字追加アセントOverbarExtraAscenderです.

    OverExtraAscender is OverbarExtraAscender.

注意
Note
最大でAccentBaseHeightである行アセントを持つ, アクセント上側添え字や基となる式に対して, [OPEN-FONT-FORMAT] [TEXBOOK]の決まりが, 上側添え字や基となる式の欧文ベースラインを実際に揃えます. このことは, アクセントの字形が, それらの字面の下端が欧文ベースラインから概ねAccentBaseHeight上にあるように設計されていると見なしています. よって, 上の決まりは, 全ての上側添え字の下端が, 基となる式との衝突を避けて揃えられることを保証するでしょう. しかしながら, MathMLは任意のアクセントを持つことができるので, 上側添え字の下端が基となる式の欧文ベースラインから少なくともAccentBaseHeight上にあることを確かなものにする, より一般的で単純な決まりが上で提供されています.
For accent overscripts and bases with line-ascents that are at most AccentBaseHeight, the rule from [OPEN-FONT-FORMAT] [TEXBOOK] is actually to align the alphabetic baselines of the overscripts and of the bases. This assumes that accent glyphs are designed in such a way that their ink bottoms are more or less AccentBaseHeight above their alphabetic baselines. Hence, the previous rule will guarantee that all the overscript bottoms are aligned while still avoiding collision with the bases. However, MathML can have arbitrary accent overscripts, so a more general and simpler rule is provided above: Ensure that the bottom of overscript is at least AccentBaseHeight above the alphabetic baseline of the base.

添え字付きの式の数学コンテンツの行アセントは, 次の中で最大のものです.

The line-ascent of the math content is the maximum between:

添え字付きの式の数学コンテンツの行ディセントは, 次の中で最大のものです.

The line-descent of the math content is the maximum between:

moverの基となる式欧文ベースラインは, 全体の欧文ベースラインに揃えられます. moverの上側添え字欧文ベースラインは, 全体の欧文ベースラインから, 基となる式の字面行アセント + 上側添え字移動距離の分, 行上面の方へずらされます.

The alphabetic baseline of the mover base is aligned with the alphabetic baseline. The alphabetic baseline of the mover overscript is shifted away from the alphabetic baseline and towards the line-over by a distance equal to the ink line-ascent of the base + OverShift.

数学コンテンツボックスは, 内容ボックスの中で, お互いのブロック始端が揃えられるように, 左右の両端の真ん中がお互いに同じ場所になるように位置決めされます.

The math content box is placed within the content box so that their block-start edges are aligned and the middles of these edges are at the same position.

3.4.2.5 下側・上側添え字と式
Base with underscript and overscript

<munderover>の一般的な配置は, 22に示されるとおりです. 大きな演算子のイタリック補正, 下側添え字移動距離, 下側添え字追加ディセント, 上側添え字移動距離, 上側添え字追加アセントのパラメータは, 3.4.2.3 下側添え字と式3.4.2.4 上側添え字と式と同じように算出されます.

The general layout of <munderover> is shown on Figure 22. The LargeOpItalicCorrection, UnderShift, UnderExtraDescender, OverShift, OverExtraDescender parameters are calculated the same as in 3.4.2.3 Base with underscript and 3.4.2.4 Base with overscript.

22 <munderover>要素に対するボックスモデル
Figure 22 Box model for the <munderover> element

添え字付きの式の数学コンテンツの最小内容行内サイズ, 最大内容行内サイズ, 行内サイズは, 行内移動距離の最大値と行内移動距離の最小値の差の絶対値として算出されます. これらの極値は, 3.4.2.3 下側添え字と式3.4.2.4 上側添え字と式で算出された相当するものの極値の, 最大・最小の値を用いて算出されます. munderoverの基となる式, munderoverの下側添え字, munderoverの上側添え字行内移動距離は, それらの節でのように, ただし, (相当する最小値の中で最小である)新しい最小値 m を用いて算出されます.

The min-content inline size, max-content inline size and inline size of the math content are calculated as an absolute difference between a maximum inline offset and minimum inline offset. These extrema are calculated by taking the extremum value of the corresponding extrema calculated in 3.4.2.3 Base with underscript and 3.4.2.4 Base with overscript. The inline offsets of the munderover base, munderover underscript and munderover overscript are calculated as in these sections but using the new minimum m (minimum of the corresponding minima).

それらの節でのように, フロー内子要素は, 行内軸に沿って演算子を伸長するアルゴリズムを使用して配置されます.

Like in these sections, the in-flow children are laid out using the algorithm for stretching operators along the inline axis.

添え字付きの式の数学コンテンツの行アセント行ディセントは, 3.4.2.3 下側添え字と式3.4.2.4 上側添え字と式で算出された極値の中で, 最大・最小の値を用いて算出されます.

The line-ascent and line-descent of the math content are also calculated by taking the extremum value of the extrema calculated in 3.4.2.3 Base with underscript and 3.4.2.4 Base with overscript.

最終的に, munderoverの基となる式, munderoverの下側添え字 , munderoverの上側添え字欧文ベースラインは, 3.4.2.3 下側添え字と式3.4.2.4 上側添え字と式の節でのように計算されます.

Finally, the alphabetic baselines of the munderover base, munderover underscript and munderover overscript are calculated as in sections 3.4.2.3 Base with underscript and 3.4.2.4 Base with overscript.

数学コンテンツボックスは, 内容ボックスの中で, お互いのブロック始端が揃えられるように, 左右の両端の真ん中がお互いに同じ場所になるように位置決めされます.

The math content box is placed within the content box so that their block-start edges are aligned and the middles of these edges are at the same position.

注意
Note

下側添え字(または, 上側添え字)が空のボックスの場合, 基となる式と上側添え字(または, 下側添え字)は, 3.4.2.4 上側添え字と式(または, 3.4.2.3 下側添え字と式)と同じように配置されます. ただし, 空の下側添え字(または, 上側添え字)の場所には, 追加の空間が付け加えられるかもしれません. アルゴリズムを単純に保つため, 空の添え字を特別な方法で取り扱う試みは何ら行われていません.

When the underscript (respectively overscript) is an empty box, the base and overscript (respectively underscript) are laid out similarly to 3.4.2.4 Base with overscript (respectively 3.4.2.3 Base with underscript) but the position of the empty underscript (respectively overscript) may add extra space. In order to keep the algorithm simple, no attempt is made to handle empty scripts in a special way.

3.4.3 前置の添え字とテンソル添え字 <mmultiscripts>
Prescripts and Tensor Indices <mmultiscripts>

前置の添え字やテンソル添え字は, mmultiscripts要素によって表されます. mprescripts要素は, 後置の添え字と前置の添え字の間の区切りとして使用されます. この2つの要素は, 2.1.3 共通の属性で述べられている属性を持ちます.

Presubscripts and tensor notations are represented by the mmultiscripts element. The mprescripts element is used as a separator between the postscripts and prescripts. These two elements accept the attributes described in 2.1.3 Global Attributes.

次の例は, mprescriptsを含む, 前置と後置の添え字の基本的な使用方法を示しています. 空のmrow要素は, 何も添え字が描画されない場所で使用されています. フォントサイズは, 添え字に対して自動的に縮小されます.

The following example shows basic use of prescripts and postscripts, involving a mprescripts. Empty mrow elements are used at positions where no scripts are rendered. The font-size is automatically scaled down within the scripts.

<math>
  <mmultiscripts>
    <mn>1</mn>
    <mn>2</mn>
    <mn>3</mn>
    <mrow></mrow>
    <mn>5</mn>
    <mprescripts/>
    <mn>6</mn>
    <mrow></mrow>
    <mn>8</mn>
    <mn>9</mn>
  </mmultiscripts>
</math>
mmultiscripts example

<mmultiscripts>要素または<mprescripts>要素が, block mathまたはinline mathに等しいdisplayプロパティの算出値を持たないならば, その要素は, 指定されたプロパティに対応する値について述べているCSS仕様書によって配置されます. そうでなければ, 後で述べる配置が行われます.

If the <mmultiscripts> or <mprescripts> elements do not have their computed display property equal to block math or inline math then they are laid out according to the CSS specification where the corresponding value is described. Otherwise, the layout below is performed.

<mprescripts>要素は, mrow要素のように配置されます.

The <mprescripts> element is laid out as an mrow element.

有効な<mmultiscripts>要素は, 次に示すフロー内子要素を含みます.

A valid <mmultiscripts> element contains the following in-flow children:

  • mmultiscriptsの基となる式と呼ばれる, mprescripts要素でない, 最初のフロー内子要素.
    A first in-flow child, called the mmultiscripts base, that is not an mprescripts element.
  • それに続く, mmultiscriptsの後置添え字と呼ばれる, mprescripts要素でない, 偶数個のフロー内子要素. それらの添え字は, (空の場合もある)下付き添え字, 上付き添え字, 下付き添え字, 上付き添え字といったリストを形作ります. 下付き添え字, 上付き添え字の子要素の連続する各1組は, 下付き・上付き添え字の組と呼ばれます.
    Followed by an even number of in-flow children called mmultiscripts postscripts, none of them being a mprescripts element. These scripts form a (possibly empty) list subscript, superscript, subscript, superscript, subscript, superscript, etc. Each consecutive couple of children subscript, superscript is called a subscript/superscript pair.
  • 省略してもよい, それに続く, mprescripts要素と, mmultiscriptsの前置添え字と呼ばれる, mprescripts要素でない, 偶数個のフロー内子要素. それらの添え字は, (空の場合もある)下付き・上付き添え字の組のリストを形作ります.
    Optionally followed by an mprescripts element and an even number of in-flow children called mmultiscripts prescripts, none of them being a mprescripts element. These scripts form a (possibly empty) list of subscript/superscript pair.

<mmultiscripts>要素が有効でない場合, mrow要素と同じように配置されます. そうでない場合, 配置のアルゴリズムは, 3.4.3.1 前置・後置の添え字と式のとおり実行されます.

If an <mmultiscripts> element is not valid then it is laid out the same as the mrow element. Otherwise the layout algorithm is performed as in 3.4.3.1 Base with prescripts and postscripts.

3.4.3.1 前置・後置の添え字と式
Base with prescripts and postscripts

<mmultiscripts>要素は, 23で示されたように配置されます. mmultiscriptsの後置添え字の各下付き・上付き添え字の組に対して, イタリック補正, 大きな演算子のイタリック補正は, 3.4.1.2 下付き添え字と式3.4.1.3 上付き添え字と式での定義と同じように, 定義されます.

The <mmultiscripts> element is laid out as shown on Figure 23. For each subscript/superscript pair of mmultiscripts postscripts, the ItalicCorrection LargeOpItalicCorrection are defined as in 3.4.1.2 Base with subscript and 3.4.1.3 Base with superscript.

23 <mmultiscripts>要素に対するボックスモデル
Figure 23 Box model for the <mmultiscripts> element

添え字付きの式の数学コンテンツの最小内容行内サイズ(または, 最大内容行内サイズ)は, 後で述べる数学コンテンツの行内サイズと同じように, ただし, mmultiscriptsの基となる式マージンボックスや添え字のマージンボックスに対する"行内サイズ"を, "最小内容行内サイズ"(または, "最大内容行内サイズ")に置き換えて算出します.

The min-content inline size (respectively max-content inline size) of the math content is calculated the same as the inline size of the math content below, but replacing "inline size" with "min-content inline size" (respectively "max-content inline size") for the mmultiscripts base's margin box and scripts' margin boxes.

行内伸長サイズ制限またはブロック伸長サイズ制限がある場合, mmultiscriptsの基となる式も同じサイズ制限を伴って配置されます. そうでない場合, 何らサイズ制限無しで配置されます. 他の要素は, いつでも何らサイズ制限無しに配置されます.

If there is an inline stretch size constraint or a block stretch size constraint the mmultiscripts base is also laid out with the same stretch size constraint. Otherwise it is laid out without any stretch size constraint. The other elements are always laid out without any stretch size constraint.

添え字付きの式の数学コンテンツの行内サイズは, 次のアルゴリズムによって算出されます.

The inline size of the math content is calculated with the following algorithm:

  1. inline-offsetを0に設定します.
    Set inline-offset to 0.
  2. mmultiscriptsの前置演算子の各下付き・上付き添え字の組に対して, inline-offsetSpaceAfterScript + 次の中の最大値分増やします.

    For each subscript/superscript pair of mmultiscripts prescripts, increment inline-offset by SpaceAfterScript + the maximum of

  3. inline-offsetmmultiscriptsの基となる式マージンボックス行内サイズ分増やし, inline-sizeinline-offsetに設定します.
    Increment inline-offset by the inline size of the mmultiscripts base's margin box and set inline-size to inline-offset.
  4. mmultiscriptsの後置添え字の各下付き・上付き添え字の組に対して, 少なくとも次の値以上にinline-sizeを修正します.

    For each subscript/superscript pair of mmultiscripts postscripts, modify inline-size to be at least:

    inline-offsetを次の中の最大値まで増やします.

    Increment inline-offset to the maximum of:

    inline-offsetSpaceAfterScript分増やします.

    Increment inline-offset by SpaceAfterScript.

  5. inline-sizeを返します.
    Return inline-size.

下付き添え字移動距離(または, 上付き添え字移動距離)は, 3.4.1.4 下付き・上付き添え字と式で述べられているように, 各下付き・上付き添え字の組の全ての下付き添え字移動距離(または, 上付き添え字移動距離)の最大値を求めることで算出します.

SubShift (respectively SuperShift) is calculated by taking the maximum of all subshifts (respectively supershifts) of each subscript/superscript pair as described in 3.4.1.4 Base with subscript and superscript.

添え字付きの式の数学コンテンツの行アセントは, 3.4.1.4 下付き・上付き添え字と式で述べられているように, ただし, 上で算出した下付き添え字移動距離上付き添え字移動距離を使用して, 各下付き・上付き添え字の組の全ての行アセントの中の最大値を求めることで算出します.

The line-ascent of the math content is calculated by taking the maximum of all the line-ascent of each subscript/superscript pair as described in 3.4.1.4 Base with subscript and superscript but using the SubShift and SuperShift values calculated above.

添え字付きの式の数学コンテンツの行ディセントは, 3.4.1.4 下付き・上付き添え字と式で述べられているように, ただし, 上で算出した下付き添え字移動距離上付き添え字移動距離を使用して, 各下付き・上付き添え字の組の全ての行ディセントの中の最大値を求めることで算出します.

The line-descent of the math content is calculated by taking the maximum of all the line-descent of each subscript/superscript pair as described in 3.4.1.4 Base with subscript and superscript but using the SubShift and SuperShift values calculated above.

最終的に, フロー内子要素の配置は, 次のアルゴリズムを使用して行われます.

Finally, the placement of the in-flow children is performed using the following algorithm:

  1. inline-offsetを0に設定します.
    Set inline-offset to 0.
  2. mmultiscriptsの前置添え字の各下付き・上付き添え字の組に対して次のことを行います.

    For each subscript/superscript pair of mmultiscripts prescripts:

    1. inline-offsetSpaceAfterScript分増やします.
      Increment inline-offset by SpaceAfterScript.
    2. pair-inline-sizeを次の中の最大値に設定します.
      Set pair-inline-size to the maximum of
    3. 下付き添え字を, 行内始端がinline-offset + pair-inline-size − 下付き添え字のマージンボックス行内サイズとなるように配置します.
      Place the subscript at inline-start position inline-offset + pair-inline-size − the inline size of the subscript's margin box.
    4. 上付き添え字を, 行内始端がinline-offset + pair-inline-size − 上付き添え字のマージンボックス行内サイズとなるようにに配置します.
      Place the superscript at inline-start position inline-offset + pair-inline-size − the inline size of the superscript's margin box.
    5. 下付き添え字(または, 上付き添え字)の欧文ベースラインを全体の欧文ベースラインから下付き添え字移動距離(または, 上付き添え字移動距離)の分, 行下面(または, 行上面)の方へずらされるように, 添え字を配置します.
      Place the subscript (respectively superscript) so its alphabetic baseline is shifted away from the alphabetic baseline by SubShift (respectively SuperShift) towards the line-under (respectively line-over).
    6. inline-offsetpair-inline-size分増やします.
      Increment inline-offset by pair-inline-size.
  3. mmultiscriptsの基となる式<mprescripts>のボックスを, 行内移動距離inline-offsetになるように, 欧文ベースラインが全体の欧文ベースラインに揃えられるように配置します.
    Place the mmultiscripts base and <mprescripts> boxes at inline offsets inline-offset and with their alphabetic baselines aligned with the alphabetic baseline.
  4. mmultiscriptsの後置添え字の各下付き・上付き添え字に対して次のことを行います.

    For each subscript/superscript pair of mmultiscripts postscripts:

    1. pair-inline-sizeを次の中の最大値まで増やします.
      Set pair-inline-size to the maximum of
    2. 下付き添え字を, 行内始端がinline-offset大きな演算子のイタリック補正となるように配置します.
      Place the subscript at inline-start position inline-offsetLargeOpItalicCorrection.
    3. 上付き添え字を, 行内始端がinline-offset + イタリック補正となるように配置します.
      Place the superscript at inline-start position inline-offset + ItalicCorrection.
    4. 下付き添え字(または, 上付き添え字)の欧文ベースラインを全体の欧文ベースラインから下付き添え字移動距離(または, 上付き添え字移動距離)の分, 行下面(または, 行上面)の方へずらされるように, 添え字を配置します.
      Place the subscript (superscript) so its alphabetic baseline is shifted away from the alphabetic baseline by SubShift (respectively SuperShift) towards the line-under (respectively line-over).
    5. inline-offsetpair-inline-size分増やします.
      Increment inline-offset by pair-inline-size.
    6. inline-offsetSpaceAfterScript分増やします.
      Increment inline-offset by SpaceAfterScript.
注意
Note

mmultiscriptsの後置添え字下付き・上付き添え字の組を1つのみ持つ<mmultiscripts>は, 同じフロー内子要素を持つ<msubsup>と同じように配置されます. ただし, これに加えて, <msubsup>の注意のように, 下付き添え字(または, 上付き添え字)が空のボックスであるなら, 必ずしも<msub>要素(または, <msup>要素)と同じようには配置されません. アルゴリズムを単純に保つため, 空の添え字を特別な方法で取り扱う試みは何ら行われていません.

An <mmultiscripts> with only one subscript/superscript pair of mmultiscripts postscripts is laid out the same as a <msubsup> with the same in-flow children. However, as noticed for <msubsup>, if additionally the subscript (respectively superscript) is an empty box then it is not necessarily laid out the same as an <msub> (respectively <msup>) element. In order to keep the algorithm simple, no attempt is made to handle empty scripts in a special way.

3.4.4 添え字におけるdisplaystyle, scriptlevel, math-shift
Displaystyle, scriptlevel and math-shift in scripts

全ての添え字要素に対して, 経験的にdisplaystylefalseに設定し, 最初のものを除く全ての子要素のscriptlevelを増やします. ただし, 大文字・小文字を区別せずにtrueに一致するaccent属性を持つmover要素(または, munderover要素)については, 2番目の子要素(または, 3番目の子要素)のscriptlevelを増やしません. 同様に, 大文字・小文字を区別せずにtrueに一致すaccentunder属性を持つmover要素とmunderover要素については, 2番目の子要素のscriptlevelを増やしません.

For all scripted elements, the rule of thumb is to set displaystyle to false and to increment scriptlevel in all child elements but the first one. However, an mover (respectively munderover) element with an accent attribute that is an ASCII case-insensitive match to true does not increment scriptlevel within its second child (respectively third child). Similarly, mover and munderover elements with an accentunder attribute that is an ASCII case-insensitive match to true do not increment scriptlevel within their second child.

<mmultiscripts>は, mprescriptsよりに前にある偶数番目の子要素と, mprescriptsより後にある奇数番目の子要素の, math-shiftcompactに設定します. <msub>要素と<msubsup>要素は, 2番目の子要素のmath-shiftcompactに設定します. また, 大文字・小文字を区別せずにtrueに一致するaccent属性を持つmover要素とmunderover要素は, 最初の子要素のmath-shiftcompactに設定します.

<mmultiscripts> sets math-shift to compact on its children at even position if they are before an mprescripts, and on those at odd position if they are after an mprescripts. The <msub> and <msubsup> elements set math-shift to compact on their second child. mover and munderover elements with an accent attribute that is an ASCII case-insensitive match to true also set math-shift to compact within their first child.

A. ユーザーエージェントのスタイルシートは, この挙動を実装するために, 次の決まりを含まなければなりません.

The A. User Agent Stylesheet must contain the following style in order to implement this behavior:

msub > :not(:first-child),
msup > :not(:first-child),
msubsup > :not(:first-child),
mmultiscripts > :not(:first-child),
munder > :not(:first-child),
mover > :not(:first-child),
munderover > :not(:first-child) {
  math-depth: add(1);
  math-style: compact;
}
munder[accentunder="true" i] > :nth-child(2),
mover[accent="true" i] > :nth-child(2),
munderover[accentunder="true" i] > :nth-child(2),
munderover[accent="true" i] > :nth-child(3) {
  font-size: inherit;
}
msub > :nth-child(2),
msubsup > :nth-child(2),
mmultiscripts > :nth-child(even),
mmultiscripts > mprescripts ~ :nth-child(odd),
mover[accent="true" i] > :first-child,
munderover[accent="true" i] > :first-child {
  math-shift: compact;
}
mmultiscripts > mprescripts ~ :nth-child(even) {
  math-shift: inherit;
}
注意
Note
実際のところ, この節で述べたMathML要素の子要素は全てフロー内要素で, <mprescripts>は空要素です. したがって, CSSの決まりは, 本質的には添え字に対する自動的なdisplaystylescriptlevelの変更, また, 下付き添え字や, 時には基となる式に対するmath-shiftの変更として機能します.
In practice, all the children of the MathML elements described in this section are in-flow and the <mprescripts> is empty. Hence the CSS rules essentially perform automatic displaystyle and scriptlevel changes for the scripts; and math-shift changes for subscripts and sometimes the base.

3.5 表のような数学
Tabular Math

行列, 配列, その他の表のような数学表記は,mtable要素, mtr要素, mtd要素を使用して記述されます. これらの要素は, [HTML]のtable要素, tr要素, td要素に類似しています.

Matrices, arrays and other table-like mathematical notation are marked up using mtable mtr mtd elements. These elements are similar to the table, tr and td elements of [HTML].

次の例は, 表の配置が行列を書くことを, どのように可能にするかについて示しています. この要素は, 分数の線や等号の中心に合わせて, 鉛直方向に中央揃えされることに注意して下さい.

The following example shows how tabular layout allows to write a matrix. Note that it is vertically centered with the fraction bar and the middle of the equal sign.

<math>
  <mfrac>
    <mi>A</mi>
    <mn>2</mn>
  </mfrac>
  <mo>=</mo>
  <mrow>
    <mo>(</mo>
    <mtable>
      <mtr>
        <mtd><mn>1</mn></mtd>
        <mtd><mn>2</mn></mtd>
        <mtd><mn>3</mn></mtd>
      </mtr>
      <mtr>
        <mtd><mn>4</mn></mtd>
        <mtd><mn>5</mn></mtd>
        <mtd><mn>6</mn></mtd>
      </mtr>
      <mtr>
        <mtd><mn>7</mn></mtd>
        <mtd><mn>8</mn></mtd>
        <mtd><mn>9</mn></mtd>
      </mtr>
    </mtable>
    <mo>)</mo>
  </mrow>
</math>
tables example

3.5.1 表や行列 <mtable>
Table or Matrix <mtable>

mtableは, inline-tableとして配置され, displaystylefalseに設定します. ユーザーエージェントのスタイルシートは, これらのプロパティを実装するために, 次の決まりを含まなければなりません.

The mtable is laid out as an inline-table and sets displaystyle to false. The user agent stylesheet must contain the following rules in order to implement these properties:

mtable {
  display: inline-table;
  math-style: compact;
}

mtable要素は, CSSのtableのようであり, 最小内容行内サイズ, 最大内容行内サイズ, 行内サイズ, ブロックサイズ, 最初の基準線集合, 最後の基準線集合は, CSSに応じて決められます. 表の中心は, 数学軸に揃えられます.

The mtable element is as a CSS table and the min-content inline size, max-content inline size, inline size, block size, first baseline set and last baseline set sets are determined accordingly. The center of the table is aligned with the math axis.

<mtable>は, 2.1.3 共通の属性で述べられている属性を持ちます.

The <mtable> accepts the attributes described in 2.1.3 Global Attributes.

3.5.2 表や行列の行 <mtr>
Row in Table or Matrix <mtr>

mtrは, table-rowとして配置されます. ユーザーエージェントのスタイルシートは, この挙動を実装するために, 次の決まりを含まなければなりません.

The mtr is laid out as table-row. The user agent stylesheet must contain the following rules in order to implement that behavior:

mtr {
  display: table-row;
}

<mtr>は, 2.1.3 共通の属性で述べられている属性を持ちます.

The <mtr> accepts the attributes described in 2.1.3 Global Attributes.

3.5.3 表や行列の要素 <mtd>
Entry in Table or Matrix <mtd>

mtdは, 要素の中で中央揃えされる中身と所定の余白を伴って, table-cellとして配置されます. ユーザーエージェントのスタイルシートは, 次の決まりを含まなければなりません.

The mtd is laid out as a table-cell with content centered in the cell and a default padding. The user agent stylesheet must contain the following rules:

mtd {
  display: table-cell;
  /* Centering inside table cells should rely on box alignment properties.
     See https://github.com/w3c/mathml-core/issues/156 */
  (訳注:"表の要素の中で中央揃えするには, ボックス位置揃えプロパティに頼るべきです.
   https://github.com/w3c/mathml-core/issues/156を参照して下さい."の意味)
  text-align: center;
  padding: 0.5ex 0.4em;
}

<mtd>は, 2.1.3 共通の属性で述べられている属性と, 次の属性を持ちます.

The <mtd> accepts the attributes described in 2.1.3 Global Attributes as well as the following attributes:

columnspan属性(または, rowspan属性)は, [HTML]の<td>要素のcolspan属性(または, rowspan属性)と同じ構文と意味を持ちます. 特に, それらの属性の処理は, 常に"colspan"を"columnspan"として読み替えながら, 行を処理するアルゴリズムで説明されているとおりに扱われます.

The columnspan (respectively rowspan) attribute has the same syntax and semantics as the colspan (respectively rowspan) attribute on the <td> element from [HTML]. In particular, the parsing of these attributes is handled as described in the algorithm for processing rows, always reading "colspan" as "columnspan".

注意
Note
[MathML3]や従前版での列を広げる属性の名前はcolumnspanで, 下位互換性のために予約されています.
The name of the column spanning attribute in [MathML3] and earlier versions is columnspan and is preserved for backward compatibility reasons.

<mtd>要素は, 名前無し<mrow>ボックスを生成します.

The <mtd> element generates an anonymous <mrow> box.

3.6 式に動きを付ける
Enlivening Expressions

歴史的に, maction要素は, 式に動きを結び付ける仕組みを提供します.

Historically, the maction element provides a mechanism for binding actions to expressions.

<maction>要素は, 2.1.3 共通の属性で述べられている属性と, 次の属性を持ちます.

The <maction> element accepts the attributes described in 2.1.3 Global Attributes as well as the following attributes:

この仕様書は, actiontype属性とselection属性に指定する何ら注目すべき挙動を定義していません.

This specification does not define any observable behavior that is specific to the actiontype and selection attributes.

次の例は, 描画ソフトウェアが代わる代わる選択された式を表示する, "3分の1"から始まって, ("4分の1", "2分の1", "3分の1", など)の選択された式をクリックするたびに循環させる, [MathML3]での動作の型"toggle"を示しています. これらは, MathMLコアの一部ではありませんが, JavaScriptとCSSポリフィルを用いて実装することができます. 通常の挙動は, 単に最初の子要素を描画します.

The following example shows the "toggle" action type from [MathML3] where the renderer alternately displays the selected subexpression, starting from "one third" and cycling through them when there is a click on the selected subexpression ("one quarter", "one half", "one third", etc). This is not part of MathML Core but can be implemented using JavaScript and CSS polyfills. The default behavior is just to render the first child.

<math>
  <maction actiontype="toggle" selection="2">
    <mfrac>
      <mn>1</mn>
      <mn>2</mn>
    </mfrac>
    <mfrac>
      <mn>1</mn>
      <mn>3</mn>
    </mfrac>
    <mfrac>
      <mn>1</mn>
      <mn>4</mn>
    </mfrac>
  </maction>
</math>
maction example

<maction>要素の配置アルゴリズムは, <mrow>要素のものと同じです. ユーザーエージェントのスタイルシートは, 昔からのactiontypeの値に対する所定の挙動のとおり, 最初の子要素以外の全ての要素を隠すために, 次の決まりを含まなければなりません.

The layout algorithm of the <maction> element is the same as the <mrow> element. The user agent stylesheet must contain the following rules in order to hide all but its first child element, which is the default behavior for the legacy actiontype values:

maction > :not(:first-child) {
  display: none;
}
注意
Note
<maction>は, 完全なMathMLとの互換性のための実装です. MathMLコアのみを対象とする著者は, 個別の動作を実装するのに, 他のHTML, CSS, JavaScriptの仕組みを利用することが推奨されます. それらは, [MathML3]で定義されたmaction属性を当てにしてもよいです.
<maction> is implemented for compatibility with full MathML. Authors whose only target is MathML Core are encouraged to use other HTML, CSS and JavaScript mechanisms to implement custom actions. They may rely on maction attributes defined in [MathML3].

3.7 意味と表現
Semantics and Presentation

semantics要素は, MathMLの式に付加情報を付け加える入れ物要素です. 典型的に, <semantics>要素は, 最初の子要素としてMathMLの式を持ち, その式の後に続く子要素が付け加えられます. 後に続く子要素は, annotation要素の中の文字列の付加情報や, annotation-xml要素の中のより複雑なマークアップの付加情報を表します.

The semantics element is the container element that associates annotations with a MathML expression. Typically, the <semantics> element has as its first child element a MathML expression to be annotated while subsequent child elements represent text annotations within an annotation element, or more complex markup annotations within an annotation-xml element.

次の例は, どのように分数"2分の1"に, 文字列の付加情報(LaTeX)や, XML付加情報(コンテントMathML)を付け加えるかを示しています. これらの付加情報は, ユーザーエージェントに描画されることを意図していません. この分数は, 同じ描画となるSVGやHTMLのマークアップも付け加えられています.

The following example shows how the fraction "one half" can be annotated with a textual annotation (LaTeX) or an XML annotation (content MathML), which are not intended to be rendered by the user agent. This fraction is also annotated with equivalent SVG and HTML markup.

<math>
  <semantics>
    <mfrac>
      <mn>1</mn>
      <mn>2</mn>
    </mfrac>
    <annotation encoding="application/x-tex">\frac{1}{2}</annotation>
    <annotation-xml encoding="application/mathml-content+xml">
      <apply>
        <divide/>
         <cn>1</cn>
         <cn>2</cn>
      </apply>
    </annotation-xml>
    <annotation-xml>
      <svg width="25" height="75" xmlns="http://www.w3.org/2000/svg">
        <path stroke-width="5.8743"
              d="m5.9157 27.415h6.601v-22.783l-7.1813 1.4402v-3.6805l7.1408
                 -1.4402h4.0406v26.464h6.601v3.4005h-17.203z"/>
        <path stroke="#000000" stroke-width="2.3409"
              d="m0.83496 39.228h23.327"/>
        <path stroke-width="5.8743"
              d="m8.696 70.638h14.102v3.4005h-18.963v-3.4005q2.3004-2.3804
                 6.2608-6.3813 3.9806-4.0206 5.0007-5.1808 1.9403-2.1803
                 2.7004-3.6805 0.78011-1.5202 0.78011-2.9804 0-2.3804
                 -1.6802-3.8806-1.6603-1.5002-4.3406-1.5002-1.9003 0-4.0206
                 0.6601-2.1003 0.6601-4.5007 2.0003v-4.0806q2.4404-0.98013
                 4.5607-1.4802 2.1203-0.50007 3.8806-0.50007 4.6407 0 7.401
                 2.3203 2.7604 2.3203 2.7604 6.2009 0 1.8403-0.7001 3.5006
                 -0.68013 1.6402-2.5004 3.8806-0.50007 0.58009-3.1805 3.3605
                 -2.6804 2.7604-7.5614 7.7412z"/>
      </svg>
    </annotation-xml>
    <annotation-xml encoding="application/xhtml+xml">
      <div style="display: inline-flex;
                  flex-direction: column; align-items: center;">
        <div>1</div>
        <div></div>
        <div>2</div>
      </div>
    </annotation-xml>
  </semantics>
</math>
semantics example

<semantics>要素は, 2.1.3 共通の属性で述べられている属性を持ちます. この配置アルゴリズムは, mrow要素のものと同じです. ユーザーエージェントのスタイルシートは, 付加情報の付いたMathMLの式のみを描画するために, 次の決まりを含まなければなりません.

The <semantics> element accepts the attributes described in 2.1.3 Global Attributes. Its layout algorithm is the same as the mrow element. The user agent stylesheet must contain the following rule in order to only render the annotated MathML expression:

semantics > :not(:first-child) {
  display: none;
}

<annotation-xml>要素と<annotation>要素は, 2.1.3 共通の属性で述べられている属性と, 次の属性を持ちます.

The <annotation-xml> and <annotation> element accepts the attributes described in 2.1.3 Global Attributes as well as the following attribute:

この仕様書は, encoding属性に指定する何ら注目すべき挙動を定義していません.

This specification does not define any observable behavior that is specific to the encoding attribute.

<annotation-xml>要素と<annotation>要素の配置アルゴリズムは, mtext要素のものと同じです.

The layout algorithm of the <annotation-xml> and <annotation> element is the same as the mtext element.

注意
Note
著者は, HTMLの結合部分, クリップボードへのコピー, 代替の描画などの付加情報を区別するために, encoding属性を使用できます. 特に, CSSは, 代替の付加情報などを描画するのに使用できます.
Authors can use the encoding attribute to distinguish annotations for HTML integration point, clipboard copy, alternative rendering, etc. In particular, CSS can be used to render alternative annotations, e.g.
/* Hide the annotated child. */
(訳注:"付け加えられた子要素を隠す"の意味)
semantics > :first-child { display: none; }
 /* Show all text annotations. */
(訳注:"文字列の付加情報を全て表示する"の意味)
semantics > annotation { display: inline; }
/* Show all HTML annotations. */
(訳注:"HTML付加情報を全て表示する"の意味)
semantics > annotation-xml[encoding="text/html" i],
semantics > annotation-xml[encoding="application/xhtml+xml" i] {
  display: inline-block;
}

4. 数学配置のためのCSS拡張
CSS Extensions for Math Layout

4.1 display: block mathと値display: inline math
The display: block math and display: inline math value

CSS Display Module Level 3(訳注:"CSS表示モジュール"の意味)からのdisplayプロパティは, 新しい内部表示型で拡張されます.

The display property from CSS Display Module Level 3 is extended with a new inner display type:

名前:
Name:
display
新しい値:
New value:
<display-outside> || [ <display-inside> | math ]

MathML要素でない要素に対して, displayの指定値がinline mathまたはblock mathである場合, 算出値は, それぞれblock flowinline flowです. mtable要素に対しては, 算出値は, それぞれblock tableinline tableです. mtr要素に対しては, 算出値はtable-rowです. mtd要素に対しては, 算出値はtable-cellです.

For elements that are not MathML elements, if the specified value of display is inline math or block math then the computed value is block flow and inline flow respectively. For the mtable element the computed value is block table and inline table respectively. For the mtr element, the computed value is table-row. For the mtd element, the computed value is table-cell.

block mathまたはinline mathに等しいdisplayの算出値を持つMathML要素は, 関係する節で述べられているように, ボックスの生成やそれらのタグの名前に応じた配置を制御します. MathML未知要素は, mrow要素と同じようにふるまいます.

MathML elements with a computed display value equal to block math or inline math control box generation and layout according to their tag name, as described in the relevant sections. Unknown MathML elements behave the same as the mrow element.

注意
Note
display: block mathと値display: inline mathは, MathML要素に対する所定の配置を提供し, 同時に元々のdisplayの値または特別な値でその値を上書きすることが認められています. このことは, 著者やポリフィルに, MathMLコアを微調整したり拡張したりするための, 独自の特別な値を定義することを認めています.
The display: block math and display: inline math values provide a default layout for MathML elements while at the same time allowing to override it with either native display values or custom values. This allows authors or polyfills to define their own custom notations to tweak or extend MathML Core.

次の例において, MathMLmrow要素の所定の配置を, 格子として中身を描画するよう上書きします.

In the following example, the default layout of the MathML mrow element is overridden to render its content as a grid.

<math>
  <msup>
    <mrow>
      <mo symmetric="false">[</mo>
      <mrow style="display: block; width: 4.5em;">
        <mrow style="display: grid;
                     grid-template-columns: 1.5em 1.5em 1.5em;
                     grid-template-rows: 1.5em 1.5em;
                     justify-items: center;
                     align-items: center;">
          <mn>12</mn>
          <mn>34</mn>
          <mn>56</mn>
          <mn>7</mn>
          <mn>8</mn>
          <mn>9</mn>
        </mrow>
      </mrow>
      <mo symmetric="false">]</mo>
    </mrow>
    <mi>α</mi>
  </msup>
</math>
display example

4.2 新しいtext-transformの値
New text-transform values

CSS Text Module Level 3(訳注:"CSSテキストモジュール")からのtext-transformプロパティは新しい値で拡張されます.

The text-transform property from CSS Text Module Level 3 is extended with a new value:

名前:
Name:
text-transform
新しい値:
New value:
math-auto

単独の文字を含むテキストノードにおいて, 算出値がmath-autoの場合, 変形された文字は, 各文字をitalicの対応表によって変換を行うことで得られます.

On text nodes containing a single character, if the computed value is math-auto then the transformed text is obtained by performing conversion of each character according to the italic table.

一般的な書式の慣行は, 複数の文字から成る識別子(例えば関数の名前"exp")を通常の字体で, 単独の文字から成る識別子(例えば, 変数"n")をイタリック体で描画することです. math-autoプロパティは, 必要なら著者が上書きできる, それらの所定の挙動を実装することを意図しています. 数学フォントは, イタリック体のフォントの書式を通じて得られた書体とは異なる, C.13 italicの対応表のユニコードの位置にある, 特別な種類のイタリック体の字形で設計されていることに注意して下さい. 次の例は, font-style: italic(左)とtext-transform: math-auto(右)を使用した, Latin Modern Mathフォントで描画した数式を比較しています.

A common style convention is to render identifiers with multiple letters (e.g. the function name "exp") with normal style and identifiers with a single letter (e.g. the variable "n") with italic style. The math-auto property is intended to implement this default behavior, which can be overridden by authors if necessary. Note that mathematical fonts are designed with a special kind of italic glyphs located at the Unicode positions of C.13 italic mappings, which differ from the shaping obtained via italic font style. Compare this mathematical formula rendered with the Latin Modern Math font using font-style: italic (left) and text-transform: math-auto (right):

font-style: italic VS text-transform: math-auto

4.3 math-styleプロパティ
The math-style property

名前:
Name:
math-style
値:
Value:
normal | compact
初期値:
Initial:
normal
適用対象:
Applies to:
全ての要素
All elements
継承:
Inherited:
する
yes
百分率:
Percentages:
受容しない
n/a
算出値:
Computed value:
特定の用語
specified keyword
正規順序:
Canonical order:
なし
n/a
アニメーション型:
Animation type:
アニメーション不可
not animatable
メディア:
Media:
visual

math-stylecompactのとき, 子孫要素における数学配置は, 次の決まりを適用することで論理高さを最小化しようとします.

When math-style is compact, the math layout on descendants tries to minimize the logical height by applying the following rules:

次の例は, math-style: compact(左)とmath-style: normal(右)で書式を決められたmathの根と一緒に描画された数式を示しています. 前者では, フォントサイズは, 分数の中で自動的に縮小され, 総和の極限は, ∑の下付き添え字と上付き添え字として描画されます. 後者では, ∑は, 通常の文字より大きく描画され, (現在のフォントサイズに関係してさえいる)分数の鉛直方向の離隔は, より大きくなります.

The following example shows a mathematical formula rendered with its math root styled with math-style: compact (left) and math-style: normal (right). In the former case, the font-size is automatically scaled down within the fractions and the summation limits are rendered as subscript and superscript of the ∑. In the latter case, the ∑ is drawn bigger than normal text and vertical gaps within fractions (even relative to current font-size) are larger.

math-style example

これら2つのmath-styleの値は, 典型的にそれぞれ[TeXBook]のインラインモードとディスプレイモードでの数式に対応します. ディスプレイモードの数式は, (例えば, 添え字, 行列の要素, 分子や分母などの)何らかの式の中で自動的にインラインモードに切り替えられてもよく, また, この所定の挙動を上書きすることが望ましいときもあります. math-styleプロパティは, MathMLに対するこれらの機能を, ユーザーエージェントのスタイルシートの中やdisplaystyle属性によって, もしくは, ポリフィルにそれらを触れさせることで簡潔に実装してもよいです.

These two math-style values typically correspond to mathematical expressions in inline and display mode respectively [TeXBook]. A mathematical formula in display mode may automatically switch to inline mode within some subformulas (e.g. scripts, matrix elements, numerators and denominators, etc) and it is sometimes desirable to override this default behavior. The math-style property allows to easily implement these features for MathML in the user agent stylesheet and with the displaystyle attribute; and also exposes them to polyfills.

4.4 math-shiftプロパティ
The math-shift property

名前:
Name:
math-shift
値:
Value:
normal | compact
初期値:
Initial:
normal
適用対象:
Applies to:
全ての要素
All elements
継承:
Inherited:
する
yes
百分率:
Percentages:
受容しない
n/a
算出値:
Computed value:
特定の用語
specified keyword
正規順序:
Canonical order:
なし
n/a
アニメーション型:
Animation type:
アニメーション不可
not animatable
メディア:
Media:
visual

math-shiftの値がcompactの場合, 子孫要素における数学配置は, 上付き添え字の位置を決めるのにsuperscriptShiftUpCrampedパラメータを使用するでしょう. math-shiftの値がnormalの場合, 数学配置は, 代わりにsuperscriptShiftUpパラメータを使用するでしょう.

If the value of math-shift is compact, the math layout on descendants will use the superscriptShiftUpCramped parameter to place superscript. If the value of math-shift is normal, the math will use the superscriptShiftUp parameter instead.

このプロパティは, MathML添え字要素の配置において, 上付き添え字の位置を決めるのに使用されます. § 3.4.1 下付きや上付きの添え字<msub>, <msup>, <msubsup>, 3.4.3 前置の添え字とテンソル添え字<mmultiscripts>, 3.4.2 下側や上側の添え字<munder>, <mover>, <munderover>を参照して下さい.

This property is used for positioning superscript during the layout of MathML scripted elements. See § 3.4.1 Subscripts and Superscripts <msub>, <msup>, <msubsup>, 3.4.3 Prescripts and Tensor Indices <mmultiscripts> and 3.4.2 Underscripts and Overscripts <munder>, <mover>, <munderover>.

次の例において, 2つの"xの2乗"は, math-styleがcompactで, font-sizeが同じもので描画されています. ただし, 平方根の中のものは, math-shiftがcompactで描画され, もう一方は, math-shiftがnormalで描画されており, 上付き添え字"2"の微妙な移動距離の違いとなっています.

In the following example, the two "x squared" are rendered with compact math-style and the same font-size. However, the one within the square root is rendered with compact math-shift while the other one is rendered with normal math-shift, leading to subtle different shift of the superscript "2".

math-shift example

[TeXBook]を通じて, 数式は, normalの書式を通常使用しますが, (例えば, 根, 分数の分母などの)何らかの式の中で, (Texの用語で"cramped"(訳注:"窮屈"の意味)である)compactの書式に切り替わってもよいです. math-shiftプロパティは, MathMLに対するこれらの決まりをユーザーエージェントのスタイルシートの中で簡単に実装できます. 文書の著者やポリフィルの開発者も, 所定の実装を微調整したり洗練したりするのに, このプロパティに触れることで実現に近づいてもよいです.

Per [TeXBook], a mathematical formula uses normal style by default but may switch to compact style ("cramped" in TeX's terminology) within some subformulas (e.g. radicals, fraction denominators, etc). The math-shift property allows to easily implement these rules for MathML in the user agent stylesheet. Page authors or developers of polyfills may also benefit from having access to this property to tweak or refine the default implementation.

4.5 math-depthプロパティ
The math-depth property

新しいmath-depthプロパティは, 数式の各要素に対する, その式の一番上の入れ物要素に関連した"深さ"の表記について述べるために導入されました. 具体的に, このプロパティは, font-sizeプロパティの指定値がmathのときに, このプロパティの算出値を決めるのに使われます.

A new math-depth property is introduced to describe a notion of "depth" for each element of a mathematical formula, with respect to the top-level container of that formula. Concretely, this is used to determine the computed value of the font-size property when its specified value is math.

名前:
Name:
math-depth
値:
Value:
auto-add | add(<integer>) | <integer>
初期値:
Initial:
0
適用対象:
Applies to:
全ての要素
All elements
継承:
Inherited:
する
yes
百分率:
Percentages:
受容しない
n/a
算出値:
Computed value:
整数, 下記参照
an integer, see below
正規順序:
Canonical order:
なし
n/a
アニメーション型:
Animation type:
アニメーション不可
not animatable
メディア:
Media:
visual

math-depthの値の算出値は, 次のように決められます.

The computed value of the math-depth value is determined as follows:

font-sizeの指定値がmathの場合, font-sizeの算出値は, font-sizeの継承された値に, 次の手続きで算出される0でない換算係数を掛けることで得られます.

If the specified value font-size is math then the computed value of font-size is obtained by multiplying the inherited value of font-size by a nonzero scale factor calculated by the following procedure:

  1. Aを継承されたmath-depthの値, Bをmath-depthの算出値, Cを0.71, Sを1.0とします.
    Let A be the inherited math-depth value, B the computed math-depth value, C be 0.71 and S be 1.0
    • A = Bなら, Sを返します.
      If A = B then return S.
    • B < Aなら AとBを交換し, InvertScaleFactorをtrueに設定します.
      If B < A, swap A and B and set InvertScaleFactor to true.
    • いずれでもなくB > Aなら, InvertScaleFactorをfalseに設定します.
      Otherwise B > A and set InvertScaleFactor to false.
  2. EをB - A > 0とします.
    Let E be B - A > 0.
  3. 継承された可用な最初のフォントがOpenType MATHテーブルを持っている場合,
    If the inherited first available font has an OpenType MATH table:
  4. SにCEを掛けます.
    Multiply S by CE.
  5. InvertScaleFactorがfalseならSを, そうでなければ1/Sを返します.
    Return S if InvertScaleFactor is false and 1/S otherwise.

次の例は, math-styleがnormalで, Latin Modern Mathフォントで描画した数式を示しています. 添え字や分数のような式を入力する場合, フォントサイズは, フォントに含まれているMATHテーブルの値によって自動的に縮小されます. フォントサイズは, 上付き添え字を入力する場合に縮小されますが, 根の指数を入力する場合はさらに小さくなります. また, フォントサイズは, 分数の中の分数を入力する場合にも縮小されますが, そうでないものは, 分数の中のmath-styleが自動的に変更されるため, 縮小されません.

The following example shows a mathematical formula with normal math-style rendered with the Latin Modern Math font. When entering subexpressions like scripts or fractions, the font-size is automatically scaled down according to the values of MATH table contained in that font. Note that font-size is scaled down when entering the superscripts but even faster when entering a root's prescript. Also it is scaled down when entering the inner fraction but not when entering the outer one, due to automatic change of math-style in fractions.

font-size-scriptlevel example

[TeXBook]からのこれらの決まりは巧妙で, これらを表現し制御する独立したmath-depthの仕組みを持つことは有用です. これらは, ユーザーエージェントのスタイルシートを使用して, MathMLの中で実装されます. 文書の著者やポリフィルの開発者は, 所定の実装を微調整したり洗練したりするのに, このプロパティに触れることで実現に近づいてもよいです. 特に, MathMLのscriptlevel属性は, math-depthの変更を行う方法を提供します.

These rules from [TeXBook] are subtle and it's worth having a separate math-depth mechanism to express and handle them. They can be implemented in MathML using the user agent stylesheet. Page authors or developers of polyfills may also benefit from having access to this property to tweak or refine the default implementation. In particular, the scriptlevel attribute from MathML provides a way to perform math-depth changes.

5. OpenType MATHテーブル
OpenType MATH table

この章は, OpenTypeフォント[OPEN-FONT-FORMAT]のMATHテーブルによって提供される機能について述べています. この章の至るところで, Cに似た表記Table.Subtable1[index].Subtable2.ParameterがOpenTypeパラメータを示すために使用されています. そのようなパラメータは, (例えば, フォントが下位テーブルの1つを欠いている, 無効な移動距離を持っているといった具合に)利用できないかもしれず, そのため予備の選択肢が提供されます.

This chapter describes features provided by MATH table of an OpenType font [OPEN-FONT-FORMAT]. Throughout this chapter, a C-like notation Table.Subtable1[index].Subtable2.Parameter is used to denote OpenType parameters. Such parameters may not be available (e.g. if the font lacks one of the subtable, has an invalid offset, etc) and so fallback options are provided.

注意
Note
好ましいOpenTypeの機能と数学フォントを使用して, MathMLを描画することが強く推奨されます. 提供される予備の選択肢が描画に十分良いものを提供する保証は何らありません.
It is strongly encouraged to render MathML with a math font with the proper OpenType features. There is no guarantee that the fallback options provided will provide good enough rendering.

設計単位で(場合によってはMathValueRecordの入力を通じて間接的に)表されたOpenTypeの値は, head.unitsPerEm, CSSのfont-size, 拡大倍率を考慮して配置の意図に対する適切な値に縮尺を変更されます.

OpenType values expressed in design units (perhaps indirectly via a MathValueRecord entry) are scaled to appropriate values for layout purpose, taking into account head.unitsPerEm, CSS font-size or zoom level.

5.1 配置の定数(MathConstants)
Layout constants (MathConstants)

可用な最初のフォントに対する共通の配置の定数があります.

These are global layout constants for the first available font:

Default fallback constant
0
Default rule thickness
post.underlineThickness, または, その定数が利用できない場合, Default fallback constant.
post.underlineThickness or Default fallback constant if the constant is not available.
scriptPercentScaleDown
MATH.MathConstants.scriptPercentScaleDown / 100, または, MATH.MathConstants.scriptPercentScaleDownがnullか利用できない場合, 0.71.
MATH.MathConstants.scriptPercentScaleDown / 100 or 0.71 if MATH.MathConstants.scriptPercentScaleDown is null or not available.
scriptScriptPercentScaleDown
MATH.MathConstants.scriptScriptPercentScaleDown / 100, または, MATH.MathConstants.scriptScriptPercentScaleDownがnullか利用できない場合, 0.5041.
MATH.MathConstants.scriptScriptPercentScaleDown / 100 or 0.5041 if MATH.MathConstants.scriptScriptPercentScaleDown is null or not available.
displayOperatorMinHeight
MATH.MathConstants.displayOperatorMinHeight, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.displayOperatorMinHeight or Default fallback constant if the constant is not available.
axisHeight
MATH.MathConstants.axisHeight, または, その定数が利用できない場合, OS/2.sxHeightの半分.
MATH.MathConstants.axisHeight or half OS/2.sxHeight if the constant is not available.
accentBaseHeight
MATH.MathConstants.accentBaseHeight, または, その定数が利用できない場合, OS/2.sxHeight.
MATH.MathConstants.accentBaseHeight or OS/2.sxHeight if the constant is not available.
subscriptShiftDown
MATH.MathConstants.subscriptShiftDown, または, その定数が利用できない場合, OS/2.ySubscriptYOffset.
MATH.MathConstants.subscriptShiftDown or OS/2.ySubscriptYOffset if the constant is not available.
subscriptTopMax
MATH.MathConstants.subscriptTopMax, または, その定数が利用できない場合, ⅘ × OS/2.sxHeight.
MATH.MathConstants.subscriptTopMax or ⅘ × OS/2.sxHeight if the constant is not available.
subscriptBaselineDropMin
MATH.MathConstants.subscriptBaselineDropMin, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.subscriptBaselineDropMin or Default fallback constant if the constant is not available.
superscriptShiftUp
MATH.MathConstants.superscriptShiftUp, または, その定数が利用できない場合, OS/2.ySuperscriptYOffset.
MATH.MathConstants.superscriptShiftUp or OS/2.ySuperscriptYOffset if the constant is not available.
superscriptShiftUpCramped
MATH.MathConstants.superscriptShiftUpCramped, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.superscriptShiftUpCramped or Default fallback constant if the constant is not available.
superscriptBottomMin
MATH.MathConstants.superscriptBottomMin, または, その定数が利用できない場合, ¼ × OS/2.sxHeight.
MATH.MathConstants.superscriptBottomMin or ¼ × OS/2.sxHeight if the constant is not available.
superscriptBaselineDropMax
MATH.MathConstants.superscriptBaselineDropMax, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.superscriptBaselineDropMax or Default fallback constant if the constant is not available.
subSuperscriptGapMin
MATH.MathConstants.subSuperscriptGapMin, または, その定数が利用できない場合, 4 × default rule thickness.
MATH.MathConstants.subSuperscriptGapMin or 4 × default rule thickness if the constant is not available.
superscriptBottomMaxWithSubscript
MATH.MathConstants.superscriptBottomMaxWithSubscript, または, その定数が利用できない場合, ⅘ × OS/2.sxHeight.
MATH.MathConstants.superscriptBottomMaxWithSubscript or ⅘ × OS/2.sxHeight if the constant is not available.
spaceAfterScript
MATH.MathConstants.spaceAfterScript, または, その定数が利用できない場合, 1/24em.
MATH.MathConstants.spaceAfterScript or 1/24em if the constant is not available.
upperLimitGapMin
MATH.MathConstants.upperLimitGapMin, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.upperLimitGapMin or Default fallback constant if the constant is not available.
upperLimitBaselineRiseMin
MATH.MathConstants.upperLimitBaselineRiseMin, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.upperLimitBaselineRiseMin or Default fallback constant if the constant is not available.
lowerLimitGapMin
MATH.MathConstants.lowerLimitGapMin, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.lowerLimitGapMin or Default fallback constant if the constant is not available.
lowerLimitBaselineDropMin
MATH.MathConstants.lowerLimitBaselineDropMin, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.lowerLimitBaselineDropMin or Default fallback constant if the constant is not available.
stackTopShiftUp
MATH.MathConstants.stackTopShiftUp, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.stackTopShiftUp or Default fallback constant if the constant is not available.
stackTopDisplayStyleShiftUp
MATH.MathConstants.stackTopDisplayStyleShiftUp, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.stackTopDisplayStyleShiftUp or Default fallback constant if the constant is not available.
stackBottomShiftDown
MATH.MathConstants.stackBottomShiftDown, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.stackBottomShiftDown or Default fallback constant if the constant is not available.
stackBottomDisplayStyleShiftDown
MATH.MathConstants.stackBottomDisplayStyleShiftDown, または, その定数が利用できない場合, Default fallback constant
MATH.MathConstants.stackBottomDisplayStyleShiftDown or Default fallback constant if the constant is not available.
stackGapMin
MATH.MathConstants.stackGapMin, または, その定数が利用できない場合, 3 × default rule thickness.
MATH.MathConstants.stackGapMin or 3 × default rule thickness if the constant is not available.
stackDisplayStyleGapMin
MATH.MathConstants.stackDisplayStyleGapMin, または, その定数が利用できない場合, 7 × default rule thickness.
MATH.MathConstants.stackDisplayStyleGapMin or 7 × default rule thickness if the constant is not available.
stretchStackTopShiftUp
MATH.MathConstants.stretchStackTopShiftUp, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.stretchStackTopShiftUp or Default fallback constant if the constant is not available.
stretchStackBottomShiftDown
MATH.MathConstants.stretchStackBottomShiftDown, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.stretchStackBottomShiftDown or Default fallback constant if the constant is not available.
stretchStackGapAboveMin
MATH.MathConstants.stretchStackGapAboveMin, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.stretchStackGapAboveMin or Default fallback constant if the constant is not available.
stretchStackGapBelowMin
MATH.MathConstants.stretchStackGapBelowMin, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.stretchStackGapBelowMin or Default fallback constant if the constant is not available.
fractionNumeratorShiftUp
MATH.MathConstants.fractionNumeratorShiftUp, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.fractionNumeratorShiftUp or Default fallback constant if the constant is not available.
fractionNumeratorDisplayStyleShiftUp
MATH.MathConstants.fractionNumeratorDisplayStyleShiftUp, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.fractionNumeratorDisplayStyleShiftUp or Default fallback constant if the constant is not available.
fractionDenominatorShiftDown
MATH.MathConstants.fractionDenominatorShiftDown, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.fractionDenominatorShiftDown or Default fallback constant if the constant is not available.
fractionDenominatorDisplayStyleShiftDown
MATH.MathConstants.fractionDenominatorDisplayStyleShiftDown, または, その定数が利用できない場合, Default fallback constant.
MATH.MathConstants.fractionDenominatorDisplayStyleShiftDown or Default fallback constant if the constant is not available.
fractionNumeratorGapMin
MATH.MathConstants.fractionNumeratorGapMin, または, その定数が利用できない場合, default rule thickness
MATH.MathConstants.fractionNumeratorGapMin or default rule thickness if the constant is not available.
fractionNumDisplayStyleGapMin
MATH.MathConstants.fractionNumDisplayStyleGapMin, または, その定数が利用できない場合, 3 × default rule thickness.
MATH.MathConstants.fractionNumDisplayStyleGapMin or 3 × default rule thickness if the constant is not available.
fractionRuleThickness
MATH.MathConstants.fractionRuleThickness, または, その定数が利用できない場合, default rule thickness.
MATH.MathConstants.fractionRuleThickness or default rule thickness if the constant is not available.
fractionDenominatorGapMin
MATH.MathConstants.fractionDenominatorGapMin, または, その定数が利用できない場合, default rule thickness.
MATH.MathConstants.fractionDenominatorGapMin or default rule thickness if the constant is not available.
fractionDenomDisplayStyleGapMin
MATH.MathConstants.fractionDenomDisplayStyleGapMin, または, その定数が利用できない場合, 3 × default rule thickness.
MATH.MathConstants.fractionDenomDisplayStyleGapMin or 3 × default rule thickness if the constant is not available.
overbarVerticalGap
MATH.MathConstants.overbarVerticalGap, または, その定数が利用できない場合, 3 × default rule thickness.
MATH.MathConstants.overbarVerticalGap or 3 × default rule thickness if the constant is not available.
overbarExtraAscender
MATH.MathConstants.overbarExtraAscender, または, その定数が利用できない場合, default rule thickness.
MATH.MathConstants.overbarExtraAscender or default rule thickness if the constant is not available.
underbarVerticalGap
MATH.MathConstants.underbarVerticalGap, または, その定数が利用できない場合, 3 × default rule thickness.
MATH.MathConstants.underbarVerticalGap or 3 × default rule thickness if the constant is not available.
underbarExtraDescender
MATH.MathConstants.underbarExtraDescender, または, その定数が利用できない場合, default rule thickness.
MATH.MathConstants.underbarExtraDescender or default rule thickness if the constant is not available.
radicalVerticalGap
MATH.MathConstants.radicalVerticalGap, または, その定数が利用できない場合, 1¼ × default rule thickness.
MATH.MathConstants.radicalVerticalGap or 1¼ × default rule thickness if the constant is not available.
radicalDisplayStyleVerticalGap
MATH.MathConstants.radicalDisplayStyleVerticalGap, または, その定数が利用できない場合, default rule thickness + ¼ OS/2.sxHeight.
MATH.MathConstants.radicalDisplayStyleVerticalGap or default rule thickness + ¼ OS/2.sxHeight if the constant is not available.
radicalRuleThickness
MATH.MathConstants.radicalRuleThickness, または, その定数が利用できない場合, default rule thickness.
MATH.MathConstants.radicalRuleThickness or default rule thickness if the constant is not available.
radicalExtraAscender
MATH.MathConstants.radicalExtraAscender, または, その定数が利用できない場合, default rule thickness.
MATH.MathConstants.radicalExtraAscender or default rule thickness if the constant is not available.
radicalKernBeforeDegree
MATH.MathConstants.radicalKernBeforeDegree, または, その定数が利用できない場合, 5/18em.
MATH.MathConstants.radicalKernBeforeDegree or 5/18em if the constant is not available.
radicalKernAfterDegree
MATH.MathConstants.radicalKernAfterDegree, または, その定数が利用できない場合, −10/18em.
MATH.MathConstants.radicalKernAfterDegree or −10/18em if the constant is not available.
radicalDegreeBottomRaisePercent
MATH.MathConstants.radicalDegreeBottomRaisePercent / 100.0, または, その定数が利用できない場合, 0.6.
MATH.MathConstants.radicalDegreeBottomRaisePercent / 100.0 or 0.6 if the constant is not available.

5.2 字形の情報(MathGlyphInfo)
Glyph information (MathGlyphInfo)

注意
Note
MathTopAccentAttachmentは危険をはらんでいます.
MathTopAccentAttachment is at risk.

可用な最初のフォントに対する字形についてのテーブルがあります.

These are per-glyph tables for the first available font:

MathItalicsCorrectionInfo
イタリック補正の値の下位テーブルMATH.MathGlyphInfo.MathItalicsCorrectionInfo. 要求された字形に対するものがあれば, MATH.MathGlyphInfo.MathItalicsCorrectionInfo.italicsCorrectionの対応する値を使用し, そうでなければ, 0を使用します.
The subtable MATH.MathGlyphInfo.MathItalicsCorrectionInfo of italics correction values. Use the corresponding value in MATH.MathGlyphInfo.MathItalicsCorrectionInfo.italicsCorrection if there is one for the requested glyph or 0 otherwise.
MathTopAccentAttachment
行内軸に沿った, 上側の数学アクセントの位置を決めるときの下位テーブルMATH.MathGlyphInfo.MathTopAccentAttachment. 要求された字形に対するものがあれば, MATH.MathGlyphInfo.MathTopAccentAttachment.topAccentAttachmentの対応する値を使用し, そうでなければ, 字形の提案された幅の半分を使用します.
The subtable MATH.MathGlyphInfo.MathTopAccentAttachment of positioning top math accents along the inline axis. Use the corresponding value in MATH.MathGlyphInfo.MathTopAccentAttachment.topAccentAttachment if there is one for the requested glyph or half the advance width of the glyph otherwise.

5.3 演算子に対する大きさの異体字(MathVariants)
Size variants for operators (MathVariants)

この節は, MATH.MathVariantsテーブルを利用して, どのように任意の大きさの伸長された字形を制御するかについて述べています.

This section describes how to handle stretchy glyphs of arbitrary size using the MATH.MathVariants table.

5.3.1 GlyphAssemblyテーブル
The GlyphAssembly table

この節は, [OPEN-TYPE-MATH-IN-HARFBUZZ]に基づいています. 利便性のために, 次の定義が使用されます.

This section is based on [OPEN-TYPE-MATH-IN-HARFBUZZ]. For convenience, the following definitions are used:

  • ominMATH.MathVariant.minConnectorOverlapです.
    omin is MATH.MathVariant.minConnectorOverlap.
  • GlyphPartRecord.partFlagsfExtenderフラグが設定されていた場合, その場合のみ, GlyphPartRecordエクステンダ(訳注:小文字のディセンダの下部(pの脚の部分)やアセンダの上部(bの縦棒の部分)を標準より伸ばした活字の伸ばした部分)です.
    A GlyphPartRecord is an extender if and only if GlyphPartRecord.partFlags has the fExtender flag set.
  • GlyphAssemblyは, MathVariant.horizGlyphConstructionOffsetsから得られた場合は, 水平方向です. そうでない場合(MathVariant.vertGlyphConstructionOffsetsから得られた場合)は, 鉛直方向です.
    A GlyphAssembly is horizontal if it is obtained from MathVariant.horizGlyphConstructionOffsets. Otherwise it is vertical (and obtained from MathVariant.vertGlyphConstructionOffsets).
  • 与えられたGlyphAssemblyテーブルに対して, NExt(または, NNonExt)は, GlyphAssembly.partRecordsの中のエクステンダ(または, エクステンダでないもの)の数です.
    For a given GlyphAssembly table, NExt (respectively NNonExt) is the number of extenders (respectively non-extenders) in GlyphAssembly.partRecords.
  • 与えられたGlyphAssemblyテーブルに対して, SExt(または, SNonExt)は, GlyphAssembly.partRecordsの中のエクステンダ(または, エクステンダでないもの)に対するGlyphPartRecord.fullAdvanceの和です.
    For a given GlyphAssembly table, SExt (respectively SNonExt) is the sum of GlyphPartRecord.fullAdvance for all extenders (respectively non-extenders) in GlyphAssembly.partRecords.
  • SExt,NonOverlapping = SExtomin NExtは, エクステンダの何ら重なり合ってない部分の最大値の和です.
    SExt,NonOverlapping = SExtomin NExt is the sum of maximum non overlapping parts of extenders.

ユーザーエージェントは, 次の条件が満たされていないとき, GlyphAssemblyを無効な値として取り扱わなければなりません.

User agents must treat the GlyphAssembly as invalid if the following conditions are not satisfied:

  • NExt > 0. そうでなければ, エクステンダを繰り返すことで, 組立字形を組み上げることができません.
    NExt > 0. Otherwise, the assembly cannot be grown by repeating extenders.
  • SExt,NonOverlapping > 0. そうでなければ, エクステンダをつなげることで, 組立字形が組み上がりません.
    SExt,NonOverlapping > 0. Otherwise, the assembly does not grow when joining extenders.
  • GlyphAssembly.partRecordsの各GlyphPartRecordに対して, GlyphPartRecord.startConnectorLengthGlyphPartRecord.endConnectorLengthの値は, 少なくともominでなければなりません. そうでなければ, MathVariant.minConnectorOverlapの条件を満たすことが困難です.
    For each GlyphPartRecord in GlyphAssembly.partRecords, the values of GlyphPartRecord.startConnectorLength and GlyphPartRecord.endConnectorLength must be at least omin. Otherwise, it is not possible to satisfy the condition of MathVariant.minConnectorOverlap.

この仕様書において, 組立字形は, 各エクステンダをr回繰り返し, 各字形の間で同じ重ね合わせの値oを用いることで組み立てられます. そのような組み立てにおける字形の数は, AssemblyGlyphCount(r) = NNonExt + r NExtであり, 一方, 伸長サイズは, AssembySize(o, r) = SNonExt + r SExt − o (AssemblyGlyphCount(r) − 1)です.

In this specification, a glyph assembly is built by repeating each extender r times and using the same overlap value o between each glyph. The number of glyphs in such an assembly is AssemblyGlyphCount(r) = NNonExt + r NExt while the stretch size is AssembySize(o, r) = SNonExt + r SExt − o (AssemblyGlyphCount(r) − 1).

rminは, 少なくともTのサイズの組立字形を得るために必要な, 最小の繰り返しの数で, 例えば, AssembySize(omin, r) ≥ Tとなるような最小のrです. この値は, 0と((T − SNonExt + omin (NNonExt − 1)) / SExt,NonOverlapping)を切り上げた値の間の最大値として定義されます.

rmin is the minimal number of repetitions needed to obtain an assembly of size at least T, i.e. the minimal r such that AssembySize(omin, r) ≥ T. It is defined as the maximum between 0 and the ceiling of ((T − SNonExt + omin (NNonExt − 1)) / SExt,NonOverlapping).

omax,theorical = (AssembySize(0, rmin) − T) / (AssemblyGlyphCount(rmin) − 1)は, 無効な重ね合わせと一緒に組立字形の余分な大きささえ分割することで得られる理論上の重ね合わせです.

omax,theorical = (AssembySize(0, rmin) − T) / (AssemblyGlyphCount(rmin) − 1) is the theorical overlap obtained by splitting evenly the extra size of an assembly built with null overlap.

omaxは, 各エクステンダをrmin回繰り返すことで, 少なくともTの大きさの組立字形を組み立てることができる最大の重ね合わせです. AssemblyGlyphCount(rmin) ≤ 1の場合, 実際の重ね合わせの値とは無関係です. そうでない場合, omaxは次の中の最小のものと定義されます.

omax is the maximum overlap possible to build an assembly of size at least T by repeating each extender rmin times. If AssemblyGlyphCount(rmin) ≤ 1, then the actual overlap value is irrelevant. Otherwise, omax is defined to be the minimum of:

  • omax,theorical.
  • GlyphAssembly.partRecordsの, 最後の要素がエクステンダでないなら, それを除いた全ての要素に対するGlyphPartRecord.startConnectorLength.
    GlyphPartRecord.startConnectorLength for all the entries in GlyphAssembly.partRecords, excluding the last one if it is not an extender.
  • GlyphAssembly.partRecordsの, 最初の要素がエクステンダでないなら, それを除いた全ての要素に対するGlyphPartRecord.endConnectorLength.
    GlyphPartRecord.endConnectorLength for all the entries in GlyphAssembly.partRecords, excluding the first one if it is not an extender.

目標のサイズTに対する組立字形伸長サイズは, AssembySize(omax, rmin)です.

The glyph assembly stretch size for a target size T is AssembySize(omax, rmin).

組立字形幅, 組立字形アセント, 組立字形ディセントは, 次のように定義されます.

The glyph assembly width, glyph assembly ascent and glyph assembly descent are defined as follows:

  • GlyphAssemblyが鉛直方向の場合, 幅は, GlyphAssembly.partRecordsの中の, 全てのGlyphPartRecordに対するID GlyphPartRecord.glyphIDの字形における最大の提案された幅です. アセントは, 与えられた目標のサイズTに対する組立字形伸長サイズで, ディセントは, 0です.
    If GlyphAssembly is vertical, the width is the maximum advance width of the glyphs of ID GlyphPartRecord.glyphID for all the GlyphPartRecord in GlyphAssembly.partRecords, the ascent is the glyph assembly stretch size for a given target size T and the descent is 0.
  • そうでなく, GlyphAssemblyが水平方向の場合, 幅は, 与えられた目標のサイズTに対する組立字形伸長サイズです. 一方, アセント(または, ディセント)は, GlyphAssembly.partRecordsの中の, 全てのGlyphPartRecordに対するID GlyphPartRecord.glyphIDの字形における最大のアセント(または, ディセント)です.
    Otherwise, the GlyphAssembly is horizontal, the width is glyph assembly stretch size for a given target size T while the ascent (respectively descent) is the maximum ascent (respectively descent) of the glyphs of ID GlyphPartRecord.glyphID for all the GlyphPartRecord in GlyphAssembly.partRecords.

組立字形高さは, 組立字形アセント組立字形ディセントの和です.

The glyph assembly height is the sum of the glyph assembly ascent and glyph assembly descent.

注意
Note
鉛直方向(または, 水平方向)の組立字形に対する水平方向(または, 鉛直方向)の尺度は, 目標のサイズTに依存することはありません.
The horizontal (respectively vertical) metrics for a vertical (respectively horizontal) glyph assembly do not depend on the target size T.

組立字形の形成は, 次のアルゴリズムによって実現されます.

The shaping of the glyph assembly is performed with the following algorithm:

  1. rminomaxを算出します.
    Calculate rmin and omax.
  2. (x, y)(0, 0)に, RepetitionCounterを0に, PartIndexを-1に設定します.
    Set (x, y) to (0, 0), RepetitionCounter to 0 and PartIndex to -1.
  3. 次の工程を繰り返します.
    Repeat the following steps:
    1. RepetitionCounterが0の場合
      If RepetitionCounter is 0:
      1. PartIndexを増やします.
        Increment PartIndex.
      2. PartIndexGlyphAssembly.partCountなら終了します.
        If PartIndex is GlyphAssembly.partCount then stop.
      3. そうでないならば, PartGlyphAssembly.partRecords[PartIndex]に設定します. RepetitionCounterを, Partがエクステンダならrminに, そうでなければ0に設定します.
        Otherwise, set Part to GlyphAssembly.partRecords[PartIndex]. Set RepetitionCounter to rmin if Part is an extender and to 1 otherwise.
      • 組立字形が水平方向の場合, ID Part.glyphIDの字形を, その座標(左端, 欧文ベースライン)が位置(x, y)となるように描画します. xx + Part.fullAdvance − omaxに設定します.
        If the glyph assembly is horizontal then draw the glyph of ID Part.glyphID so that its (left, baseline) coordinates are at position (x, y). Set x to x + Part.fullAdvance − omax.
      • そうでない場合(組立字形が鉛直方向の場合), id Part.glyphIDの字形を, その座標(左端, 下端)が位置(x, y)となるように描画します. yy − Part.fullAdvance + omaxに設定します.
        Otherwise (if the glyph assembly is vertical), then draw the glyph of id Part.glyphID so that its (left, bottom) coordinates are at position (x, y). Set y to y − Part.fullAdvance + omax.
    2. RepetitionCounterを減らします.
      Decrement RepetitionCounter.

5.3.2 字形を伸長するアルゴリズム
Algorithms for glyph stretching

ブロック軸に沿って伸長された字形の望ましい行内サイズは, 次のアルゴリズムを使って算出されます.

The preferred inline size of a glyph stretched along the block axis is calculated using the following algorithm:

  1. Sを字形の提案された幅に設定します.
    Set S to the glyph's advance width.
  2. 与えられた字形に対するMathVariants.vertGlyphConstructionOffsetsテーブルの中にMathGlyphConstructionテーブルがある場合,
    If there is a MathGlyphConstruction table in the MathVariants.vertGlyphConstructionOffsets table for the given glyph:
    1. MathGlyphConstruction.mathGlyphVariantRecordの中の各MathGlyphVariantRecordに対して, Sが少なくともid MathGlyphVariantRecord.variantGlyphの字形の提案された幅であることを確実にします.
      For each MathGlyphVariantRecord in MathGlyphConstruction.mathGlyphVariantRecord, ensure that S is at least the advance width of the glyph of id MathGlyphVariantRecord.variantGlyph.
    2. 有効なGlyphAssembly下位テーブルがあるなら, Sが少なくとも組立字形幅であることを確実にします.
      If there is valid GlyphAssembly subtable, then ensure that S is at least the glyph assembly width.
  3. Sを返します.
    Return S.
注意
Note
ブロック軸に沿って伸長された字形の望ましい行内サイズは, その字形に対する全ての可能性のある鉛直方向の構成物の最大の幅を返すでしょう. 実際のところ, 数学フォントは, 鉛直方向の構成物がほとんど一定の幅になるように設計されていて, そのため, 実際の幅は, 過大に評価されたとしても小さくなります.
The preferred inline size of a glyph stretched along the block axis will return the maximum width of all possible vertical constructions for that glyph. In practice, math fonts are designed so that vertical constructions are almost constant width, so possible over-estimation of the actual width is small.

行内(または, ブロック)次元T伸長された字形を形作るアルゴリズムは, 次のとおりです.

The algorithm to shape a stretchy glyph to inline (respectively block) dimension T is the following:

  1. 与えられた字形に対するMathVariants.horizGlyphConstructionOffsetsテーブル(または, MathVariants.vertGlyphConstructionOffsetsテーブル)の中に何らかのMathGlyphConstructionが無いのなら, 失敗の状態を伴って完了します.
    If there is not any MathGlyphConstruction table in the MathVariants.horizGlyphConstructionOffsets table (respectively MathVariants.vertGlyphConstructionOffsets table) for the given glyph then exit with failure.
  2. 字形の提案された幅(または, 高さ)が少なくともTなら, その字形に対する通常の形状と境界ボックスを使用し, また, イタリック補正としてその字形に対するMathItalicsCorrectionInfoを使用し, 成功の状態を伴って完了します.
    If the glyph's advance width (respectively height) is at least T then use normal shaping and bounding box for that glyph, the MathItalicsCorrectionInfo for that glyph as italic correction and exit with success.
  3. MathGlyphConstruction.mathGlyphVariantRecordの中のMathGlyphVariantRecordの一覧を検索します. 1つのMathGlyphVariantRecord.advanceMeasurementが少なくともTなら, MathGlyphVariantRecord.variantGlyphに対する通常の形状と境界ボックスを使用し, また, イタリック補正としてその字形に対するMathItalicsCorrectionInfoを使用し, 成功の状態を伴って完了します.
    Browse the list of MathGlyphVariantRecord in MathGlyphConstruction.mathGlyphVariantRecord. If one MathGlyphVariantRecord.advanceMeasurement is at least T then use normal shaping and bounding box for MathGlyphVariantRecord.variantGlyph, the MathItalicsCorrectionInfo for that glyph as italic correction and exit with success.
  4. 有効なGlyphAssembly下位テーブルがあるなら, 組立字形幅, 組立字形高さ, 組立字形アセント,