The MathEditor Block for the Editor.js.
Get the package
npm i --save editorjs-mathliveor
yarn add editorjs-mathliveAdd a new Tool to the tools property of the Editor.js initial config.
import MathEditor from 'editorjs-mathlive';
var editor = EditorJS({
tools: {
math: MathEditor,
}
});Or init the MathEditor tool with additional settings
var editor = EditorJS({
tools: {
math: {
class: MathEditor,
inlineToolbar: true,
config: {
virtualKeyboardMode: 'manual',
defaultMode: 'math',
smartMode:false,
virtualKeyboardTheme:'material',
},
},
},
});| Field | Type | Description |
|---|---|---|
virtualKeyboardMode |
string |
initial mode of virtual keyboard. manual by default |
defaultMode |
string |
initial editing mode. math by default |
smartMode |
boolean |
MathEditor mode. false by default |
virtualKeyboardTheme |
string |
MathEditor keyboard theme. material by default |
| Field | Type | Option values |
|---|---|---|
virtualKeyboardMode |
string |
manual, auto, onfocus,off |
defaultMode |
string |
math , inline-math, text |
smartMode |
boolean |
false, true |
virtualKeyboardTheme |
string |
material, apple |
This Tool returns data in the following format
| Field | Type | Description |
|---|---|---|
type |
string |
Style of math text |
latex |
string |
Mathematical equation text in latexs |
{
"type" : "math",
"data" : {
"type": "cdx-math-info",
"latex" : "e=mc^2"
}
}