Math Block for Editor.js
npm install editorjs-math
Transform laTex text to pretty math equations
Demo: https://flaming-cl.github.io/editorPlugin
This is a plugin for Editor.js. To use this package, you need to install editorjs first
Here are the supported functions: https://katex.org/docs/supported.html
Get the package
``shell`
npm i --save-dev editorjs-math
Include module at your application
`javascript`
const mathTex = require('editorjs-math');
// or import MathTex from 'editorjs-math';
javascript
`Usage
Add a new Tool to the
tools property of the Editor.js initial config.`javascript
var editor = EditorJS({
...
tools: {
...
math: {
class: MathTex, // for CDN: window.MathTex
},
}
...
});
`Config Params
This Tool has no config params
Output data
| Field | Type | Description |
| ------ | -------- | ---------------- |
| text |
string | Math text |`json
{
"type" : "math",
"data" : {
"text" : "\\{1,2,3,\\ldots ,n\\}",
}
}
``