Mathematical Formulas (Tesla)

Introduction:

This plugin is my expansion for current version of Mathematical Formulas plugin. Toolbar is added for creating mathematical formulas faster. Formulas is rended by MathJax. The toolbar UI is based on CodeCogs and modified by us for rendering TeX formulas supported by MathML.

Some features expanded:

+ Toolbar in dialog for create math formulas faster:

  • Create matrix and equation by UI.
  • Insert math symbols easly.
  • ...

+ Fix bug not auto preview in firefox.

Input: laTeX (type or use toolbar)

Output: Use this function in component or script for rendering a formulas

export function formatMathemicalFormulas() {
  (function () {
    // console.log("Style MF called!");
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = "//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML";   // use the location of your MathJax

    var config = 'MathJax.Hub.Config({' +
      'extensions: ["tex2jax.js"],' +
      'jax: ["input/TeX","output/HTML-CSS"]' +
      '});' +
      'MathJax.Hub.Startup.onload();';

    if (window.opera) {
      script.innerHTML = config
    } else {
      script.text = config
    }

    script.addEventListener('load', function () {
      window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub]);
    })

    document.getElementsByTagName("head")[0].appendChild(script);
  })();
}

 

Setup:

After basic installing, please add mathJaxLib to config:

mathJaxLib: '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML'

Additional configuration:

config.mathJaxClass - sets the default class for an element that will be converted into a widget.

Bug:

Currently, this version is lack of language translation.

Another informations:

it is not supported in IE 8.

 

Screenshots

Releases

Plugin versions CKEditor versions
4.16 4.15 4.14

Version: 1.0.1

DownloadRelease notes

Fix feature not support in ES6.

Twitter Facebook Facebook Instagram Medium Linkedin GitHub Arrow down Phone Menu Close icon Check