Wiris

Documentation / MathType

  • Demos
  • Visit our website
  • Downloads
  • Contact us
  • MathType

    • WirisQuizzes

      • Nubric

        • CalcMe

          • MathPlayer

            • Store FAQ

              • MathFlow

                • BF FAQ

                  • Miscellaneous

                    • Wiris Integrations

                      • Home
                      • MathType
                      • Technical documentation
                      • MathType for HTML editors
                      • Configuration

                      Migrate image formulas to MathML

                      Reading time: 1min

                      Migrate existing MathType formulas stored as image elements to native MathML. MathType image formulas already contain their original MathML in the data-mathml attribute. Migrating to MathML consists of extracting this information, decoding it, and replacing the image element with the corresponding MathML.

                      After completing this guide, your content will store formulas as MathML instead of image elements.

                      Before you begin

                      Requirements

                      Make sure you have:

                      • Access to the HTML content containing MathType image formulas.
                      • Image formulas that include the data-mathml attribute.
                      • A deployment configured to display MathML content.

                      Applies to

                      Legacy MathType integrations using image formulas · Content being migrated to Full MathML mode

                      Steps

                      Locate MathType image formulas

                      Find all image elements with the Wirisformula class. For example:

                      <img class="Wirisformula" ... data-mathml="...">

                      Each image contains the original MathML in its data-mathml attribute.

                      Extract the MathML

                      Read the value of the data-mathml attribute. The stored MathML uses an encoded representation that must be decoded before it can be used.

                      Decode the MathML

                      Apply the following character replacements:

                      Replace With
                      « <
                      » >
                      § &
                      ¨ "
                      ` '

                      After decoding, the result is valid MathML.

                      Replace the image formulas

                      Replace each image element with the decoded MathML. For example:

                      • Instead of:
                      «mi»x«/mi»
                      • Use:
                      <mi>x</mi>

                      Repeat the process for every MathType image formula in your content.

                      Apply the migration

                      Save the updated content in your application. If your deployment uses WIRISplugins.js, ensure that it is loaded on pages displaying the migrated content.

                      Verify the configuration

                      Verify that your deployment is configured to display MathML content.

                      See Full MathML mode for additional information.

                       

                      Verify it worked

                      Open a page containing migrated formulas. Confirm that:

                      • Formulas are stored as MathML.
                      • The original image elements have been removed.
                      • Formulas render correctly.
                      • Formulas can be reopened and edited in MathType.

                      Common issues

                      No MathML is available

                      Verify that:

                      • The image contains the data-mathml attribute.
                      • The content was originally generated by MathType.

                      The migrated MathML is invalid

                      Verify that:

                      • Every replacement character has been decoded correctly.
                      • The extracted MathML has not been modified during processing.

                      Formulas do not render after migration

                      Verify that:

                      • Your deployment is configured for Full MathML mode.
                      • WIRISplugins.js is loaded on the page displaying the content.
                      • The generated MathML is valid.

                      Related articles

                      • Configure rendering output.
                      • Configure WIRISplugins.js.
                      • Full MathML mode.
                      • Modified XML encoding for MathML.

                      Was this article helpful?

                      Give feedback about this article

                      Related Articles

                      • MathType Preferences Problem when inserting equations into Microsoft Word
                      • Equations have become non-editable pictures in Microsoft Word

                      Migrate image formulas to MathML

                      Before you begin Requirements Applies to Steps Locate MathType image formulas Extract the MathML Decode the MathML Replace the image formulas Apply the migration Verify the configuration Verify it worked Common issues No MathML is available The migrated MathML is invalid Formulas do not render after migration Related articles

                      Empowering STEM education

                      MathType

                      • Office Tools
                      • LMS
                      • XML
                      • HTML

                      WirisQuizzes

                      Nubric

                      Integrations

                      Solutions

                      • Education
                      • Publishing houses – platforms and interactive
                      • Publishing houses – Print and digital
                      • Technical writers

                      Pricing

                      Downloads

                      Blog

                      • Success stories

                      About us

                      • Careers
                      • Partnership

                      Contact Us

                      Contact Sales

                      European union (European Regional Development Fund) and 1EdTech (TrustEd Apps Certified)
                      • Cookie Policy
                      • Terms of Use
                      • Privacy Policy / GDPR
                      • Student Data Privacy
                      • Compliance
                      • Cookie Settings

                      © Wiris 2026

                      Expand