Documentation / MathType

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

    • Wiris Quizzes

      • Learning Lemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Miscellaneous

                      • Home
                      • MathType
                      • MathType Integrations
                      • MathType for HTML editors
                      • MathType for HTML editors

                      MathType Generic integration

                      Reading time: 2min

                      This document will assist those developers who want to integrate MathType in their platforms, and there is not a specific integration already available. More precisely this document covers two scenarios:

                      • Integrating MathType into an HTML editor.
                      • Integrating MathType into a simple Textarea. For example in wikis, blogs and other Web applications that use plain textareas to edit rich HTML text.

                      Caution

                      Before starting any development, please, ensure that there is no integration already available for your needs.

                       

                      Demos and integration downloads

                      Demo Download
                      Live demo Quickstart codes

                      Requirements

                      • A web server with PHP or Java servlets compatibility (or another language, but our internal engine is only distributed in PHP and as Java servlet).
                      • A web server with UTF-8 encoding compatibility.
                      • Knowledge of Javascript language.
                      • A valid license to install the integration in a production environment; otherwise, you can use the downloaded file just for demo purposes.

                      Caution

                      In versions older than 3.50.0 the name of the integration directory was pluginwiris instead of generic_wiris.

                       

                      Starting

                      Technologies

                      Our integration is available for various technologies. Click below on the technology you are using to see the full instructions you should follow.

                      PHP

                      • mbstring extension must be installed and enabled in the server.
                      • Copy generic_wiris directory in your web system root path. Then, open generic_wiris/configuration.ini and set your values. This table specifies all possible parameters.
                      • Give execution right to the web server user on the PHP files contained at generic_wiris/integration.
                      • Very large formulas may not be rendered if the output_buferring option is enabled. Either disable it or set a high enough value in your server's php.ini file.
                       
                       

                      Java Servlet

                      • Install the pluginwiris_engine.war in your Java web applications server (tomcat).
                      • Copy generic_wiris directory in your web system root path. Then, open pluginwiris_engine/WEB-INF/generic_wiris/configuration.ini and set your own values.This table specifies all possible parameters. For versions older than 3.50.0 it is essential that you set wiriscachedirectory and wirisformuladirectory.
                       
                       

                      Rules

                      There are some rules for integration development:

                      Don’t edit generic_wiris/core files. These files are the integration kernel. We pledge to upgrade only those files in future versions.

                      Important complementary information

                      MathType integration follows this criterion:

                      • It uses the generic_wiris/formulas directory to save the MathML of the formulas (source of the formulas). These files are essential. If you want to migrate your web server, remember copying that directory, or your created equations (for example, in post forums) will be lost.
                      • It uses generic_wiris/cache directory to save image files. These files aren’t critical. You can delete them whenever you want; they will be created again automatically when browsers will request the images of the formulas.

                      You can use this example code to load your implementation:

                      <script type="text/javascript" src="./generic_wiris/core/core.js"></script>
                          <script type="text/javascript" src="./generic_wiris/wirisplugin-generic.js"></script>
                          

                      Environment variables

                      MathType integration core uses three global variables that you should use/modify:

                      • _wrs_currentPath: contains the current URL path (for Safari fixes).
                      • _wrs_isNewElement: you must set this Boolean variable when you are opening a new editor window true or false depending on if you are creating a new formula or editing it.
                      • _wrs_temporalImage: you must set this object variable when you are opening a new editor window. It must contain the image that you are editing. See integration.js for more information.

                      Functions

                      There are core functions that you can use but not modify. These functions are in generic_wiris/core/core.js.

                      Simple examples

                      There are simple examples of MathType Integrations that you can download.

                      Was this article helpful?

                      Yes
                      No
                      Give feedback about this article

                      Related Articles

                      • MathType for WPS Writer / Kingsoft Writer
                      • MathType MTEF v.5 (MathType 4.0 and later)
                      • MathType API documentation

                      MathType Generic integration

                      Caution Demos and integration downloads Requirements Caution Starting Technologies Rules Important complementary information Environment variables Functions Simple examples

                      Making people’s STEM work more meaningful

                      MathType

                      • MathType for Office Tools
                      • MathType for Mac
                      • MathType for Microsoft 365
                      • MathType for Google Workspace
                      • MathType for LMS
                      • MathType for XML Editors
                      • Arabic notation
                      • Our products accessibility
                      • MathType is online

                      WirisQuizzes

                      Learning Lemur

                      Solutions for Education

                      • Blackboard Learn
                      • Brightspace by D2L
                      • Canvas
                      • Google Classroom
                      • Moodle
                      • Schoology

                      Solutions for Publishing Houses

                      Solutions for Technical Writers

                      Solutions for Chemistry

                      Integrations

                      • HTML Editors
                      • MathType in WordPress

                      Pricing

                      Company

                      Careers

                      Blog

                      Contact Us

                      Buy Now

                      Plugin Downloads

                      © Wiris 2025

                      • Cookie Settings
                      • Cookie Policy
                      • Terms of Use
                      • Privacy Policy / GDPR
                      • Student Data Privacy
                      • Compliance
                      • Powered by Helpjuice
                      Expand