我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!
您也可以阅读此文章的English (US)版。

The MathML <mtext> element is used to render arbitrary text with no notational meaning, such as comments or annotations.
To display text with notational meaning, use <mi> and <mo> instead.

Attributes

class, id, style
Provided for use with stylesheets.
dir
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
href
Used to set a hyperlink to a specified URI.
mathbackground
The background color. You can use #rgb, #rrggbb and HTML color names.
mathcolor
The text color. You can use #rgb, #rrggbb and HTML color names.
mathsize
Specifies the size of the content. Possible values are:
  • small:Font is rendered smaller than the current font size.
  • normal:Equivalent to 100% or 1em.
  • big:Font is rendered larger than the current font size.
  • a custom length.
  • or a unitless value which multiplies the default.
mathvariant
This attribute specifies the logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed:
  • normal (Default value) ; Example
  • bold ; Example
  • italic ; Example
  • bold-italic ; Example
  • double-struck ; Example
  • bold-fraktur ; Example
  • script ; Example
  • bold-script ; Example
  • fraktur ; Example
  • sans-serif ; Example
  • bold-sans-serif ; Example
  • sans-serif-italic ; Example
  • sans-serif-bold-italic ; Example
  • monospace ; Example
  • normal (Default) ; مثال
  • initial ; مثال
  • tailed ; مثال
  • looped ; مثال
  • stretched ; مثال

Examples

<math> 

  <mtext> Theorem of Pythagoras </mtext>  

  <mtext> /* comment here */ </mtext>
  
</math>

Specifications

Specification Status Comment
MathML 3.0
The definition of 'mtext' in that specification.
Recommendation Current specification
MathML 2.0
The definition of 'mtext' in that specification.
Recommendation Initial specification

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support No support 1.0 (1.7 or earlier) No support No support 5.1
dir No support 12.0 (12.0) No support No support No support
href No support 7.0 (7.0) No support No support No support
mathsize No support 1.0 (1.7 or earlier) No support No support 5.1
mathvariant No support 28.0 (28.0) No support No support No support
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support No support No support 1.0 (1.9.2) No support No support No support
dir No support No support 12.0 (12.0) No support No support No support
href No support No support 7.0 (7.0) No support No support No support
mathsize No support No support 1.0 (1.9.2) No support No support No support
mathvariant No support No support 28.0 (28.0) No support No support No support

Gecko-specific notes

  • Starting with Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) a unitless value for mathsize is allowed.
  • Some mathvariant values are only implemented starting with Gecko 28.0 (Firefox 28.0 / Thunderbird 28.0 / SeaMonkey 2.25) and require appropriate math fonts.

文档标签和贡献者

 此页面的贡献者: fscholz, fred.wang, Sheppy, jswisher
 最后编辑者: fscholz,