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
                      • Getting started
                      • MathType for HTML editors
                      • MathType for CKEditor

                      Integrate MathType with CKEditor

                      Reading time: 3min

                      Use this guide to add MathType to CKEditor when you want to use MathType’s hosted services instead of installing services on your own server.

                      Before you begin

                      Requirements

                      • CKEditor 4 or CKEditor 5 installed.
                      • A valid MathType license.
                      • A working CKEditor instance already initialized in your application.

                      Applies to

                      MathType for HTML editors · CKEditor integrations

                      Steps

                      For CKEditor 4

                      Install the MathType package

                      Add the MathType plugin to your project.

                      npm install @wiris/mathtype-ckeditor4

                      Make sure your CKEditor 4 version is compatible with your project. For local tests without a CKEditor 4 LTS license, use a pre-LTS version such as ckeditor4@4.22.1.

                       

                      Add the MathType plugin as an external plugin

                      Register the MathType plugin before initializing CKEditor.

                      CKEDITOR.plugins.addExternal(
                          'ckeditor_wiris',
                          '/node_modules/@wiris/mathtype-ckeditor4/',
                          'plugin.js'
                      );

                      This example assumes that node_modules is served by your local development server. In production applications, expose the MathType integration script through your build system or copy it to a public assets directory.

                       

                      Enable the MathType plugin in CKEditor

                      Add the plugin to the CKEditor configuration.

                      CKEDITOR.replace('editor', { 
                          extraPlugins: 'ckeditor_wiris'
                      });

                      Enable MathType buttons in the toolbar

                      Add the MathType and ChemType buttons to the toolbar.

                      toolbar: [ 
                          { 
                              name: 'wirisplugins', 
                              items: [ 
                                  'ckeditor_wiris_formulaEditor', 
                                  'ckeditor_wiris_formulaEditorChemistry' 
                              ] 
                          } 
                      ]

                      Preserve MathML content

                      Allow CKEditor to preserve the MathML content used by formulas.

                      allowedContent: true

                      Without this setting, CKEditor may filter or remove MathML content when formulas are inserted, edited, or reloaded from stored content.

                      Full configuration example

                      CKEDITOR.plugins.addExternal(
                          'ckeditor_wiris',
                          '/node_modules/@wiris/mathtype-ckeditor4/',
                          'plugin.js'
                      );
                      CKEDITOR.replace('editor', {
                          extraPlugins: 'ckeditor_wiris',
                      
                      
                          // Required to preserve MathML.
                          allowedContent: true,
                      
                          toolbar: [
                              {
                                  name: 'wirisplugins',
                                  items: [
                                      'ckeditor_wiris_formulaEditor',
                                      'ckeditor_wiris_formulaEditorChemistry'
                                  ]
                              },
                              {
                                  name: 'others'
                              }
                          ]
                      });

                      Start or reload your application 

                      Apply the changes and initialize the editor.

                      For CKEditor 5

                      Install the MathType package

                      Add the MathType plugin to your project.

                      npm install @wiris/mathtype-ckeditor5

                      This integration requires a modern build system capable of processing ES modules, such as Vite, Webpack, or similar tooling. Unlike CKEditor 4, the MathType plugin is imported as a JavaScript module and bundled as part of the application build.

                       

                      Import the MathType plugin

                      Import the MathType plugin and its styles in your application entry point.

                      import MathType from '@wiris/mathtype-ckeditor5/dist/index.js';
                      import '@wiris/mathtype-ckeditor5/dist/index.css';

                      Register the MathType plugin

                      Add the MathType plugin to the CKEditor configuration.

                      ClassicEditor.create(editorElement, {
                        plugins: [
                          Essentials,
                          Paragraph,
                          Bold,
                          Italic,
                          MathType
                        ]
                      });

                      Enable MathType buttons in the toolbar

                      Add the MathType and ChemType buttons to the toolbar.

                      toolbar: [
                        'MathType',
                        'ChemType'
                      ]

                      Full configuration example

                      import {
                        ClassicEditor,
                        Essentials,
                        Paragraph,
                        Bold,
                        Italic
                      } from 'ckeditor5';
                      
                      import 'ckeditor5/ckeditor5.css';
                      
                      import MathType from '@wiris/mathtype-ckeditor5/dist/index.js';
                      import '@wiris/mathtype-ckeditor5/dist/index.css';
                      
                      ClassicEditor
                        .create(document.querySelector('#editor'), {
                      
                          plugins: [
                            Essentials,
                            Paragraph,
                            Bold,
                            Italic,
                            MathType
                          ],
                      
                          toolbar: [
                            'bold',
                            'italic',
                            'MathType',
                            'ChemType'
                          ]
                        })
                        .catch(error => {
                          console.error(error);
                        });

                      Start or reload your application

                      Apply the changes and initialize the editor.

                      Verify it worked

                      • The CKEditor editor loads correctly.
                      • MathType and ChemType buttons appear in the CKEditor toolbar.
                      • You can insert and edit a formula in the editor.
                      • Formulas render correctly inside the editor.

                      Options and variations

                      CDN-based integration

                      If you're using CKEditor 4 and want to load MathType without installing the integration package locally, you can use the CDN-hosted version of the plugin. This approach is useful when CKEditor itself is loaded from a CDN or when you want to minimize deployment complexity. See Use MathType with CKEditor 4 via CDN.

                      Framework-based integration (React, Angular, etc.)

                      If you're using a framework, the integration steps differ depending on your setup. See Use MathType with CKEditor 5 in React and Use MathType with CKEditor 5 in Angular.

                      Backend services

                      If you need backend services (Java or PHP), some deployments require additional services for formula rendering and storage. See MathType integrations deployment models.

                      Advanced configuration

                      If you need advanced configuration, you can customize the editor's behaviour (such as the toolbar, language, or editor settings). See MathType configuration options.

                      Common errors

                      The MathType button does not appear

                      The plugin may not be included in the CKEditor configuration. Check that:

                      • The MathType plugin was added to the plugins configuration.
                      • The MathType and/or ChemType toolbar items were added to the toolbar configuration.

                      Formulas are removed after saving

                      CKEditor may be filtering MathML content. For CKEditor 4, make sure allowedContent: true is enabled. CKEditor 5 preserves MathML content by default when using the MathType plugin.

                      Related

                      • MathType for CKEditor: Overview.
                      • Use MathType with CKEditor 4 via CDN.
                      • Use MathType with CKEditor 5 in React.
                      • Use MathType with CKEditor 5 in Angular.
                      • MathType integration architecture.
                      • MathType integrations deployment models.

                      Was this article helpful?

                      Give feedback about this article

                      Related Articles

                      • Using MathType with WordPress
                      • Using MathType

                      Integrate MathType with CKEditor

                      Before you begin Requirements Applies to Steps For CKEditor 4 Install the MathType package Add the MathType plugin as an external plugin Enable the MathType plugin in CKEditor Enable MathType buttons in the toolbar Preserve MathML content Full configuration example Start or reload your application For CKEditor 5 Install the MathType package Import the MathType plugin Register the MathType plugin Enable MathType buttons in the toolbar Full configuration example Start or reload your application Verify it worked Options and variations CDN-based integration Framework-based integration (React, Angular, etc.) Backend services Advanced configuration Common errors The MathType button does not appear Formulas are removed after saving Related

                      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