<annotation>

Baseline 已廣泛支援

此功能已成熟,並且在眾多裝置和瀏覽器版本上都能正常工作。自 2023 年 1 月以來,它已在各瀏覽器中可用。

<annotation> MathML 元素包含對 MathML 表示式的文字格式註釋,例如 LaTeX

注意: 註釋不應該被瀏覽器渲染,並且預設是隱藏的。然而,如果 <semantics> 元素的第一個子元素包含錯誤或缺失,Firefox 和 Safari 會渲染一些註釋格式。

屬性

該元素的屬性包括 全域性 MathML 屬性 以及以下屬性:

encoding

註釋中語義資訊的編碼(例如,"application/x-tex"

src 已棄用

外部語義資訊源的位置。

示例

html
<math display="block">
  <semantics>
    <!-- The first child is the MathML expression rendered by default. -->
    <mrow>
      <msup>
        <mi>x</mi>
        <mn>2</mn>
      </msup>
      <mo>+</mo>
      <mi>y</mi>
    </mrow>

    <!-- Annotate with LaTeX, a lightweight markup language. -->
    <annotation encoding="application/x-tex">x^{2} + y</annotation>
  </semantics>
</math>

技術摘要

隱式 ARIA 角色 None

規範

規範
MathML Core
# semantics-and-presentation

瀏覽器相容性