This sample shows the usage of the CKEditor mathematical plugin that introduces a MathJax 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 MathJax delimiters: \(
and \)
, as in the code below:
<span class="math-tex">\( \sqrt{1} + (1)^2 = 2 \)</span>
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', { extraPlugins: 'mathjax' } );
Please note that this plugin is not compatible with Internet Explorer 8.