Skip to main content

 Glossary

A-Z glossary of PageSeeder concepts

MathML

MathML  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.

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.

MathML documents

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

PageSeeder can render the MathML equation:

MathML – Equation document example (view)

Or you can view the source:

MathML – Equation document example (source)

MathML fragments

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

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

<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

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.

<!-- 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

<!-- 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 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.

<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

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

MathML – Xref example

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.

Created on , last edited on