Skip to main content

MathType for WordPress

Note

This page is for using MathType web interface in WordPress. It's also possible to use MathType Office Tools (i.e., the MathType you use in the desktop version of Microsoft Word) in WordPress. If you're looking for instructions on using MathType Office Tools in WordPress, please see our other page of instructions for that.

Downloads

MathType for WordPress integration consists of these two packages:

Requirements

  • WordPress 3.0 or higher installed.

  • TinyMCE as text editor (also known as Classic). WordPress versions earlier than 5.0 use it as default. WordPress 5.0 and later use Gutenberg, a block editor.

  • A valid license to install the integration in a production environment; otherwise, you can use the downloaded file just for demo purposes.

Install MathType for WordPress

1. Add MathType integrations to WordPress

  1. Add MathType integration to WordPress' plugins:

    Unzip MathType integration for WordPress and add tiny_mce_wiris.php inside the /wp-content/plugins folder in your WordPress installation.

  2. Add MathType integration to the TinyMCE in WordPress:

    1. Unzip the MathType integration for TinyMCE and PHP package in the WordPress section.

    2. Find the build folder in mathtype-tinymce-wordpress_x.x.x/ and rename it to tiny_mce_wiris.

    3. Add the tiny_mce_wiris directory inside /wp-includes/js/tinymce/plugins.

  3. Activate WordPress MathType integration in your WordPress plugins administration.

    1. Go to your WordPress admin dashboard.

    2. Navigate to the "Plugins" section.

    3. Find the "WordPress MathType Integration" and activate it.

2. Render MathML formulas with WIRISplugins.js

In order to render formulas on your WordPress page, add the following code to the functions.php file of your active WordPress theme.

// Adding the viewer on the Theame header
function add_custom_script_to_header() {
 wp_enqueue_script( 'custom-script', 'https://www.wiris.net/demo/plugins/app/WIRISplugins.js?viewer=image', array(), '1.0', false );
}

add_action( 'wp_enqueue_scripts', 'add_custom_script_to_header' );

Caution

Note: Some WordPress versions may add line breaks around formula images. This is related to WordPress default wpautop filter. You can disable wpautop behavior using an integration like this or you can enable the image mode in our plugin.

3. Testing

In order to check if the integration is installed correctly, there is a page that makes some tests on your server. Open this link to see where is your test page.

4. Clean and backup

Visit this page if you want to know how to clean the cache folder and backup your formula images.

Using MathType in WordPress

Note

This page is for using MathType web interface in WordPress. It's also possible to use MathType Office Tools (i.e., the MathType you use in the desktop version of Microsoft Word) in WordPress. If you're looking for instructions on using MathType Office Tools in WordPress, please see our other page of instructions for that.

The process described below covers both WordPress pages and WordPress posts, but we will not mention both. The process is the same. We further assume you are using WordPress 5.0 or later, but other than the mention of the block editor, the process is the same for earlier WordPress versions.

Write an equation

Caution

This process will not work with the standard WordPress installation. You must have either the TinyMCE Advanced plugin or the Classic Editor plugin installed (or both).

If you have the Classic Editor plugin installed, and are using Classic mode to write/edit the page, skip step 1 and proceed with step 2. These steps will assume you're working with the TinyMCE Advanced editor.

  1. You cannot add an equation to a Paragraph block. To add an equation to a post, add a Classic Paragraph block by clicking the keyboard icon on the page:

    wordpress_classic_block.png
  2. Click the MathType 7 button on the Classic toolbar to open the MathType 7 editor:

    wordpress_insert_equation.png
  3. Create the equation and click OK to insert it into the paragraph:

    wordpress_click_ok_to_insert.png

Edit an equation

  1. Select the formula you want to edit, then open MathType 7 by clicking the MathType 7 button on the toolbar.

  2. Make the changes to the formula, then click OK to save the changes to the post.

    wordpress_edit_equation.png