@evyu/latex-editor
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

Latex-Editor

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

demo

demo image

Getting started

  1. Install

    npm install @evyu/latex-editor

    or

    yarn add @evyu/latex-editor
  2. Load the latex-editor libary

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

    or

    import LatexEditor from '@evyu/latex-editor'
  3. Add a <div></div> tag. this tag is the initial of editor

    <div class="my-editor"></div>
  4. Init the latex editor: new LatexEditor(ele:HTMLElement, options: Object)

    参数 类型 是否必传 默认值
    ele HTMLElement
    content String
    option Object 详见 option
    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 去除罗马字体

Package Sidebar

Install

npm i @evyu/latex-editor

Weekly Downloads

2

Version

0.0.8

License

MIT

Unpacked Size

2.27 MB

Total Files

117

Last publish

Collaborators

  • evyu