---
title: "MathML"
source: https://dev.pageseeder.com/reference/glossary/mathml.html
description: "MathML is a W3C standard for mathematical content on the web, supported in PageSeeder for display and storage. Use `.mml` or `.mathml` file extensions for documents, or `application/mathml+xml` for fragments. PageSeeder renders math xrefs automatically and supports MathML export to Word and PDF formats."
last_updated: 2026-09-05T17:34:47+10:00
tokens: ~1081
---

# MathML

[MathML](https://www.w3.org/Math/whatIsMathML.html) is intended to facilitate the use and re-use of mathematical and scientific content on the Web. It is supported for display and storage in PageSeeder.

> **Note:** To display a mathematical expression using MathML, use the `math` xref type. PageSeeder doesn’t support any inline label to render MathML. 

*See also* [AsciiMath](asciimath.md).

## MathML documents

Use the file extension `.mml` or `.mathml` for MathML documents.

PageSeeder can render the MathML equation:

![MathML – Equation document example (view)](/content/reference/glossary/../../images/glossary/mathml_doc_example_render.webp)

Or you can view the source:

![MathML – Equation document example (source)](/content/reference/glossary/../../images/glossary/mathml_doc_example_source.webp)



## MathML fragments

Use the media type `application/mathml+xml` for MathML media fragments.

> **Note:** You don’t need to declare the MathML namespace inside a media fragment. So `<math>` is equivalent to `<math xmlns="http://www.w3.org/1998/Math/MathML">`.

**Example**



```xml
<media-fragment mediatype="application/mathml+xml">
  <math>
    <mrow>
      <mo>[</mo>
      <mtable>
        <mtr>
          <mtd>
            <mn>1</mn>
          </mtd>
          <mtd>
            <mn>0</mn>
          </mtd>
        </mtr>
        <mtr>
          <mtd>
            <mn>0</mn>
          </mtd>
          <mtd>
            <mn>1</mn>
          </mtd>
        </mtr>
      </mtable>
      <mo>]</mo>
    </mrow>
  </math>
</media-fragment>
```

Renders as:

![Mathml – Matrix example](/content/reference/glossary/../../images/glossary/mathml_matrix_example.webp)



## Math xrefs

PageSeeder automatically renders xrefs of type `math` pointing to MathML documents or fragments.

To let users select MathML documents to include in their content, you need to create a math xref config.

```xml
<!-- To insert an expression stored in MathML document -->
<xref-config name="mathml" title="MathML">
  <xref display="document"
        frag="default"
        type="math" />
  <target filters="+psmediatype:application/mathml+xml" />
</xref-config>
```

OR

```xml
<!-- To insert an expression stored in MathML fragment, which is fragment 1 of a mathml type document -->
<xref-config name="mathml" title="MathML">
  <xref display="document" 
        frag="1"
        type="math" />
  <target documenttype="mathml" />
</xref-config>
```

*See* [PSML xref config](../../guide/configuration/psml/psml_xref_config.md) for details.

### Example

The following is an example of a math xref to a MathML document.

The source in your PSML document includes the MathML content wrapped into a `<media-fragment>` element within the xref.

```xml
<para><xref id="8340" frag="default" reversefrag="6" 
            reversetitle="Examples" reverselink="true" 
            reversetype="none" display="document" config="mathml" 
            type="math" uriid="674" 
            href="/ps/sample/help/maths/standard_deviation.mathml" 
            urititle="Standard deviation" 
            mediatype="application/mathml+xml">
<media-fragment id="media" mediatype="application/mathml+xml">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mi>σ</mi>
  <mo>=</mo>
  <msqrt>
    <mfrac>
      <mn>1</mn>
      <mi>N</mi>
    </mfrac>
    <munderover>
      <mo>∑</mo>
      <mrow>
        <mi>i</mi>
        <mo>=</mo>
        <mn>1</mn>
      </mrow>
      <mi>N</mi>
    </munderover>
    <mo stretchy="false">(</mo>
    <msub>
      <mi>x</mi>
      <mi>i</mi>
    </msub>
    <mo>−</mo>
    <mi>μ</mi>
    <msup>
      <mo stretchy="false">)</mo>
      <mn>2</mn>
    </msup>
  </msqrt>
</math></media-fragment></xref>
</para>
```

Renders as:

![MathML – Standard deviation](/content/reference/glossary/../../images/glossary/mathml_math_xref_view_v60000.webp)

If you enable the **Outline transclusions** option, it shows as:

![MathML – Xref example](/content/reference/glossary/../../images/glossary/mathml_math_xref.webp)

## Publishing MathML

PageSeeder supports MathML in both Word and PDF.

Microsoft Office supports MathML, so MathML content is directly exported to the Word document.

When publishing PDF documents, PageSeeder first renders your MathML as a PNG image to include in your PDF.

