- Get MathJax-edit from GitHub
- Get modified MathJax from GitHub
- Get the MathJax-edit documentation
- Go to MathJax-edit on GitHub

MathJax-edit is a small Javascript application that allows you to mark part of a MathML formula in an HTML page and apply a correction to it.

MathJax-edit depends on MathJax. It uses a slight modification of MathJax, which marks inferred mrows in the HTML page.

MathJax-edit consists of two javascript files:

- MathJax-edit.js, the core library. It takes a selection as input and prepares it for modification. Then it takes a correction formula as input and replaces the selected part with the correction.
- call-mathjax-edit.js, an application of MathJax-edit.js. It provides a button which, when pressed, reads the selected range. Then it sets up a form in which the correction can be entered. Finally the correction is applied to the selected range.

You may check editing of MathJax formulas in the sample page sample1.html.

- Open it in your browser.
- Select part of a formula.
- Press the button 'Modify selected range'.
- Write a correction formula in the correction text box.
- Click the radio button for your type of formula.
- Press the button 'Apply correction'.

Call MathJax, MathJax-edit and call-mathjax-edit in your web page, as follows:

<script type="text/javascript" src="path/to/MathJax.js?config=TeX-MML-AM_HTMLorMML"></script> <script type="text/javascript" src="path/to/MathJax-edit.js"></script> <script type="text/javascript" src="path/to/call-mathjax-edit.js"></script>

Edit `path/to/` to match the paths to your scripts. Make sure you use
the modified version of MathJax (or make sure that your formulas
explicitly contain all mrows).

All formulas in your web page should be in MathML.

For debugging purposes you may set verbose mode as follows:

<script type="text/javascript">callMathJaxCorrection.setVerbose(true)</script>

Consult the documentation for the API of MathJax-edit. Consult call-mathjax-edit.js and its documentation as an example.

- Create a MathJaxCorrection object:
var correction = new MathJaxCorrection().

- Let the object read the selection:
correction.readSelection()

- Let the object apply the correction:
correction.applyCorrection(correctionText, correctionType)

where correctionText is the text of the correction formula. - Ask MathJax to rerender the corrected formula:
MathJax.Hub.Update(ancestor)

where`ancestor`is any ancestor containing the corrected formula.

This software is free software; you may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation Version 2, June 1991, aka "copyleft" or the GPL.

This software is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

Along with this software you should have received a copy of the GNU General
Public License. If not, see
`http://www.gnu.org/licenses/old-licenses/gpl-2.0.html`.

MathJax-edit, Copyright © 2012-2013 Simon Pepping, License: GNU General Public License Version 2, June 1991.