Equation Editor

Standalone Simple Example

Source Code

This example includes the addition of two custom buttons to the toolbar.

<head>
  <script src="https://editor.codecogs.com/eqneditor.api.min.js"></script>
</head>
<body>
<div id="equation-editor">
  <div id="history"></div>
  <div id="toolbar"></div>
  <div id="latexInput"></div>
  <div id="equation-output">
    <img id="output"/>
  </div>
</div>

<!-- Main scripts to setup and control export features of Editor -->
<script>
document.addEventListener('DOMContentLoaded', function(){

textarea = EqEditor.TextArea.link('latexInput', true)
    .addOutput(EqEditor.Output.link('output').
        setRenderURL('https://latex.codecogs.com') )
    .addHistoryMenu(new EqEditor.History('history'));

EqEditor.Toolbar.link('toolbar')
   .addTextArea(textarea)
   .appendPanel(0,{
     "name":"siunitx",
     "class":"green",
     "width":50,
     "buttons":[
         {
             "latex": "\\mp",
             "base64": "PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4KPCEtLSBHZW5lcmF0ZWQgYnkgQ29kZUNvZ3Mgd2l0aCBkdmlzdmdtIDMuMC4zIC0tPgo8c3ZnIHZlcnNpb249JzEuMScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB4bWxuczp4bGluaz0naHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluaycgd2lkdGg9JzMzLjk0MjczMnB0JyBoZWlnaHQ9JzExLjg1MDcyN3B0JyB2aWV3Qm94PSctLjIzOTA1MSAtLjIzNTI1NCAzMy45NDI3MzIgMTEuODUwNzI3Jz4KPGRlZnM+CjxwYXRoIGlkPSdnMS01MCcgZD0nTTIuMjQ3NTcyLTEuNjI1OTAzQzIuMzc1MDkzLTEuNzQ1NDU1IDIuNzA5ODM4LTIuMDA4NDY4IDIuODM3MzYtMi4xMjAwNUMzLjMzMTUwNy0yLjU3NDM0NiAzLjgwMTc0My0zLjAxMjcwMiAzLjgwMTc0My0zLjczNzk4M0MzLjgwMTc0My00LjY4NjQyNiAzLjAwNDczMi01LjMwMDEyNSAyLjAwODQ2OC01LjMw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0MjctNi44NTAzMTFDMS42NzM3MjQtNy42NjMyNjMgMi43OTc1MDktNy42NjMyNjMgMi44NTcyODUtNy42NjMyNjNDMy4yNTE4MDYtNy42NjMyNjMgNC4wMjg4OTItNy40ODM5MzUgNC4wMjg4OTItNi4zMTIzMjlDNC4wMjg4OTItNi4wODUxODEgMy45OTMwMjYtNS40MTU2OTEgMy42NDYzMjYtNC45MDE2MTlDMy4yODc2NzEtNC4zNzU1OTIgMi44ODExOTYtNC4zMzk3MjYgMi41NTg0MDYtNC4zMjc3NzFMMi4xOTk3NTEtNC4yOTE5MDVaJy8+CjwvZGVmcz4KPGcgaWQ9J3BhZ2UxJyB0cmFuc2Zvcm09J21hdHJpeCgxLjEzIDAgMCAxLjEzIC02My45ODYwNDMgLTYyLjk2OTU5MyknPgo8dXNlIHg9JzU2LjQxMzI2NycgeT0nNjUuNzUzNDI1JyB4bGluazpocmVmPScjZzItNDknLz4KPHVzZSB4PSc2Mi4yNjYyNTcnIHk9JzY1Ljc1MzQyNScgeGxpbms6aHJlZj0nI2cyLTQ4Jy8+Cjx1c2UgeD0nNjguMTE5MjQ4JyB5PSc2NS43NTM0MjUnIHhsaW5rOmhyZWY9JyNnMC01OCcvPgo8dXNlIHg9JzcxLjM3MDkwOScgeT0nNjUuNzUzNDI1JyB4bGluazpocmVmPScjZzItNTEnLz4KPHVzZSB4PSc3Ny4yMjM4OTknIHk9JzY1Ljc1MzQyNScgeGxpbms6aHJlZj0nI2cwLTEwMScvPgo8dXNlIHg9JzgyLjY0OTMzOScgeT0nNjAuODE3MjM5JyB4bGluazpocmVmPScjZzEtNTAnLz4KPC9nPgo8L3N2Zz4=",
             "width": 50,
             "operation": "insert",
             "args": ["\\num{}"],
         },
         {
             "latex": "ang",
             "width": 15,
             "operation": "insert",
             "args": ["\\ang{}"],
         }
     ]
   });
});
</script>
</body>
Further Information
Documentation API fxRender CKEditor Tiny MCE