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
                      • Reference

                      Content MathML

                      Reading time: 2min

                      This article describes how MathType works with Content MathML, including supported formats, syntax validation, and available methods for converting between Presentation MathML and Content MathML. It is intended for developers and administrators integrating MathType into web applications or server environments.

                      Requirements/Prerequisites:

                      • MathType Web integration.
                      • Access to MathType services (cloud or on-premises).
                      • MathType server components and a valid license (for Java API methods).

                      Concepts:
                      Presentation MathML describes how mathematical expressions are displayed (how an equation looks visually).
                      Content MathML describes the semantic meaning of mathematical expressions (what the formula is, rather than how it appears).

                      MathType works natively with Presentation MathML but can also import and process Content MathML. Formulas can be converted between both formats provided they are valid according to MathType's built-in content grammar.

                      For example, the following expressions are valid:

                      image.png

                      The following expressions are not valid:

                      error.png

                      For more information about formula evaluation, see Expression evaluation.

                      Reference details

                      Content MathML support:

                      Feature Supported Description
                      Content MathML input Yes The MathType editor accepts Content MathML as input.
                      Content MathML export Indirectly Requires conversion from Presentation MathML using a call to an API.
                      Presentation MathML input Yes Native MathType format.
                      Syntax checking Optional Helps identify formulas that cannot be converted to Content MathML.

                      Syntax checking

                      Syntax checking highlights formulas that are not well-formed and therefore cannot be converted to Content MathML.

                      Example:

                      screen1-1.png

                      In this example, 3+ is not considered a valid expression.

                      To enable syntax checking during editor initialization:

                      editor = com.wiris.jsEditor.JsEditor.newInstance({
                          'checkSyntax': 'true'
                      });
                      

                      To enable syntax checking after the editor has been created:

                      editor.setParams({
                          'checkSyntax': 'true'
                      });
                      

                      Importing Content MathML

                      The MathType editor accepts both Presentation MathML and Content MathML directly. Rendering services also support Content MathML when generating output formats such as PNG images.

                      Exporting Content MathML

                      The MathType editor interface only generates Presentation MathML directly. To obtain Content MathML, you must convert the generated Presentation MathML using either a web service or a server-side API.

                      Conversion method Availability Notes
                      Web service Cloud Supports GET and POST requests, but POST is recommended.
                      Java API On-premises Requires MathType server components.

                      Example usage

                      Convert Presentation MathML to Content MathML using the web service:

                      https://www.wiris.net/demo/editor/mathml2content?mml=<math><mn>1</mn><mo>-</mo><mn>2</mn></math>
                      

                      Response:

                      <math>
                          <apply>
                              <minus/>
                              <cn>1</cn>
                              <cn>2</cn>
                          </apply>
                      </math>
                      

                      Convert Presentation MathML using the Java API:

                      To use this method, you will need a license to download and run the MathType server components.

                       
                      PublicServicesInterface ps = PublicServices.getInstance();
                      Properties p = new Properties();
                      
                      String content = ps.mathml2content(
                          "<math><mn>1</mn><mo>+</mo><mn>2</mn></math>",
                          p
                      );
                      

                      For Java integrations, add WIRISeditor.jar to the application classpath.

                      Converting Content MathML to Presentation MathML

                      Since the MathType editor accepts Content MathML directly, conversion is rarely required. If needed, use the content2mathml method.

                      Example:

                      https://www.wiris.net/demo/editor/content2mathml?mml=<math><apply><minus/><cn>1</cn><cn>2</cn></apply></math>
                      

                      Response:

                      <math>
                          <mn>1</mn>
                          <mo>-</mo>
                          <mn>2</mn>
                      </math>
                      

                      Error handling:
                      Conversion may fail if the provided MathML is malformed or does not comply with MathType's Content MathML grammar. Enable syntax checking whenever possible to help identify invalid expressions before conversion.

                      Related resources:

                      • Expression evaluation
                      • MathType server components

                      Was this article helpful?

                      Give feedback about this article

                      Related Articles

                      • Supported browsers
                      • Plugins test
                      • LaTeX support
                      • Arabic
                      • MathML coverage by MathType

                      Content MathML

                      Reference details Syntax checking Importing Content MathML Exporting Content MathML Example usage Converting Content MathML to Presentation MathML

                      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