# @evyu/latex-editor

> this is a latex editor package, it provide some help with writing math formula even if you don't understand latex.

Latest version **0.0.8** (published 2023-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @evyu/latex-editor
pnpm add @evyu/latex-editor
yarn add @evyu/latex-editor
bun add @evyu/latex-editor
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2023-06-29 |
| First published | 2023-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 20 |
| Unpacked size | 2.2 MB |
| Known vulnerabilities | 0 (+14 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | evyu |
| Maintainers | evyu |
| Keywords | latex-editor, latex, mathjax |

## Links

- npm: https://www.npmjs.com/package/@evyu/latex-editor
- Repository: https://github.com/evy-u/latex-editor
- Homepage: https://github.com/evy-u/latex-editor#readme
- Issues: https://github.com/evy-u/latex-editor/issues
- npm.io page: https://npm.io/package/@evyu/latex-editor

## Dependencies (20)

- [uid](https://npm.io/package/uid.md) ^2.0.0
- [vue](https://npm.io/package/vue.md) ^3.2.26
- [sass](https://npm.io/package/sass.md) ^1.46.0
- [vant](https://npm.io/package/vant.md) ^4.0.2
- [vite](https://npm.io/package/vite.md) ^4.3.1
- [chalk](https://npm.io/package/chalk.md) ^5.0.0
- [redom](https://npm.io/package/redom.md) ^3.29.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [xregexp](https://npm.io/package/xregexp.md) ^5.1.1
- [shortcuts](https://npm.io/package/shortcuts.md) ^2.0.3
- [typescript](https://npm.io/package/typescript.md) ^4.7.2
- [vue-router](https://npm.io/package/vue-router.md) ^4.0.14
- [html2canvas](https://npm.io/package/html2canvas.md) ^1.4.1
- [element-plus](https://npm.io/package/element-plus.md) ^1.3.0-beta.5
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.194
- [recursive-match](https://npm.io/package/recursive-match.md) ^1.0.2
- [vite-plugin-dts](https://npm.io/package/vite-plugin-dts.md) ^1.2.0
- [@evyu/common-lib](https://npm.io/package/@evyu/common-lib.md) ^0.0.1
- [@vant/touch-emulator](https://npm.io/package/@vant/touch-emulator.md) ^1.4.0
- [rollup-plugin-uglify](https://npm.io/package/rollup-plugin-uglify.md) ^6.0.4

## 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

- 0.0.8 (latest) — 2023-06-29
- 0.0.7 — 2023-06-29
- 0.0.6 — 2023-06-28
- 0.0.5 — 2023-06-28
- 0.0.4 — 2023-06-28
- 0.0.3 — 2023-06-28
- 0.0.2 — 2023-06-27
- 0.0.1 — 2023-06-27

## README

# Latex-Editor

###### this is a latex editor package, it provide some help with writing math formula even if you don't understand latex.

---

**[demo](https://latex-editor.netlify.app/demo.html)**

![demo image](https://latex-editor.netlify.app/demo.gif)

## Getting started

1. **Install**

   ```bash
   npm install @evyu/latex-editor
   ```

   or

   ```bash
   yarn add @evyu/latex-editor
   ```

2. **Load the latex-editor libary**

   ```html
   <head>
     <link rel="stylesheet" href="./style.css" />
     <script src="./@evyu/latex-editor/index.umd.js"></script>
   </head>
   ```

   or

   ```javascript
   import LatexEditor from '@evyu/latex-editor'
   ```

3. **Add a `<div></div>` tag. this tag is the initial of editor**

   ```html
   <div class="my-editor"></div>
   ```

4. **Init the latex editor: new LatexEditor(ele:HTMLElement, options: Object)**

   | 参数    |    类型     | 是否必传 | 默认值      |
   | :------ | :---------: | :------- | :---------- |
   | ele     | HTMLElement | 是       |             |
   | content |   String    | 是       |             |
   | option  |   Object    | 否       | 详见 option |

   ```javascript
   new LatexEditor(document.querySelector('.my-editor'), {
     content: '\\angleABC=90\\circ',
   })
   ```

## Options

| 参数          |  类型   | 是否必传 | 默认值 | 说明                      |
| :------------ | :-----: | :------- | :----- | :------------------------ |
| lineBreak     | Boolean | 否       | true   | 换行                      |
| lineHeight    | String  | 否       | '20px' | 行高                      |
| textColor     | String  | 否       | '#333' | 文字颜色                  |
| divideChinese | Boolean | 否       | false  | 将中文从 latex 中拆分出来 |
| wrapMathrm    | Boolean | 否       | true   | 去除罗马字体              |

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