AMP
ZH
{{^prevUrl}} {{#result.components.length}}

#### 组件

{{/result.components.length}} {{/prevUrl}} {{#result.components}}

#### {{title}}

{{description}}

{{#exampleUrl}}
Open example
{{#playgroundUrl}}
Open in playground
{{/playgroundUrl}}
{{/exampleUrl}}
{{/result.components}} {{^prevUrl}} {{#result.pages.length}}

#### Results

{{/result.pages.length}} {{/prevUrl}} {{#result.pages}} {{/result.pages}} {{#result.isTruncated}}
Although there are {{result.totalResults}} hits in total we cannot show more than 100.
{{/result.isTruncated}}
Something went wrong while trying to load more search results.
We apologize for the inconvenience caused.
Please try again later.

## ;(

### Something went wrong…

…while trying to load the search results.
We apologize for the inconvenience caused.
Please try again later.

{{#components.length}}

#### Important Components

{{/components.length}} {{#components}}

#### <{{title}}>

{{description}}

{{#exampleUrl}}
Open example
{{#playgroundUrl}}
Open in playground
{{/playgroundUrl}}
{{/exampleUrl}}
{{/components}} {{#articles.length}}

#### Popular Articles

{{/articles.length}} {{#articles}} {{/articles}}

# amp-mathml

Displays a MathML formula.

 Required Script  Supported Layouts container Examples amp-mathml.amp.html

## Behavior

This extension creates an iframe and renders a MathML formula.

#### Example: The Quadratic Formula

<amp-mathml layout="container" data-formula="$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$">
</amp-mathml>


#### Example: Cauchy's Integral Formula

<amp-mathml layout="container" data-formula="$f(a) = \frac{1}{2\pi i} \oint\frac{f(z)}{z-a}dz$">
</amp-mathml>


#### Example: Double angle formula for Cosines

<amp-mathml layout="container" data-formula="$$\cos(θ+φ)=\cos(θ)\cos(φ)−\sin(θ)\sin(φ)$$">
</amp-mathml>


#### Example: Inline formula

This is an example of a formula of <amp-mathml layout="container" inline data-formula="x"></amp-mathml>, <amp-mathml layout="container" inline data-formula="$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$"></amp-mathml> placed inline in the middle of a block of text. <amp-mathml layout="container" inline data-formula="$$\cos(θ+φ)$$"></amp-mathml> This shows how the formula will fit inside a block of text and can be styled with CSS.

## Attributes

##### data-formula (required)

Specifies the formula to render.

##### inline (optional)

If specified, the component renders inline (inline-block in CSS).

## Validation

See amp-mathml rules in the AMP validator specification.

You've read this document a dozen times but it doesn't really cover all of your questions? Maybe other people felt the same: reach out to them on Stack Overflow.

Go to Stack Overflow
Found a bug or missing a feature?

The AMP project strongly encourages your participation and contributions! We hope you'll become an ongoing participant in our open source community but we also welcome one-off contributions for the issues you're particularly passionate about.

Go to GitHub