# editorjs-mathlive

> math editor for editorjs

Latest version **1.0.1** (published 2023-01-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install editorjs-mathlive
pnpm add editorjs-mathlive
yarn add editorjs-mathlive
bun add editorjs-mathlive
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-01-31 |
| First published | 2023-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 729.5 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Upendra Kumar |
| Maintainers | uk2459644 |
| Keywords | codex, codex-editor, mathlive, editorjs-mathlive, editor.js, editorjs |

## Links

- npm: https://www.npmjs.com/package/editorjs-mathlive
- Repository: https://github.com/uk2459644/editorjs-mathlive
- npm.io page: https://npm.io/package/editorjs-mathlive

## Dependencies (2)

- [boxicons](https://npm.io/package/boxicons.md) ^2.1.4
- [mathlive](https://npm.io/package/mathlive.md) ^0.87.0

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-01-31
- 1.0.0 — 2023-01-25

## README

# MathEditor tool

The MathEditor Block for the [Editor.js](https://editorjs.io). 


![editorjs-mathlive](https://user-images.githubusercontent.com/75515703/215652012-8c6bd2aa-babf-4f3f-8ec8-92b2610d7af3.gif)

<!-- 
![editorjs-mathlive](https://user-images.githubusercontent.com/75515703/215251180-38535c5e-2b87-4c1c-87d5-68629cdf97d1.png)
 -->
## Installation

Get the package

```shell
npm i --save editorjs-mathlive
```
or

```shell
yarn add editorjs-mathlive
```

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
import MathEditor from 'editorjs-mathlive';

var editor = EditorJS({
  tools: {
    math: MathEditor,
  }
});
```

Or init the MathEditor tool with additional settings

```javascript
var editor = EditorJS({
  tools: {
    math: {
      class: MathEditor,
      inlineToolbar: true,
      config: {
        virtualKeyboardMode: 'manual',
        defaultMode: 'math',
        smartMode:false,
        virtualKeyboardTheme:'material',
      },
    },
  },
});
```

## Config Params

| 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 |


## Config Params Optional values

| Field              | Type     | Option values         |
| ------------------ | -------- | ---------------------------------------- |
| `virtualKeyboardMode`             | `string` |  `manual`, `auto`, `onfocus`,`off` |
| `defaultMode`             | `string` | `math` , `inline-math`, `text` |
| `smartMode`             | `boolean` |  `false`, `true` |
| `virtualKeyboardTheme`             | `string` |  `material`, `apple` |


## Output data

This Tool returns `data` in the following format

| Field          | Type         | Description           |
| -------------- | ------------ | ----------------------------------------- |
| `type` | `string`    | Style of math text |
| `latex`      | `string` | Mathematical equation text in latexs |

```json
{
  "type" : "math",
  "data" : {
    "type": "cdx-math-info",
    "latex" : "e=mc^2"
  }
}
```

---
_Source: https://npm.io/package/editorjs-mathlive · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
