CKEditor Samples » Mathematical Formulas

This sample shows the usage of the CKEditor mathematical plugin that introduces a LCM widget. You can now use it to create or modify equations using TeX.

TeX content will be automatically replaced by a widget when you put it in a <span class="math-tex"> element. You can also add new equations by using the Math toolbar button and entering TeX content in the plugin dialog window. After you click OK, a widget will be inserted into the editor content.

The output of the editor will be plain TeX with <m> delimiters: <m> and </m>, as in the code below:

<m> \sqrt{1} + (1)^2 = 2 </m>

To transform TeX into a visual equation, a page must include the MathJax script.

In order to use the new plugin, include it in the config.extraPlugins configuration setting.

CKEDITOR.replace( 'textarea_id', {
    allowedContent: true,
    extraPlugins: 'lcm'
} );

Please note that this plugin is not compatible with Internet Explorer 8.