Convert Draftjs content to LaTeX source code.
Block Type | Supported | Block Enum | Notes |
---|---|---|---|
Bold | ✅ Yes | BOLD |
|
Italic | ✅ Yes | ITALIC |
|
Underline | ✅ Yes | UNDERLINE |
|
Inline Code | ✅ Yes | CODE |
|
H1 | ✅ Yes | header-one |
|
H2 | ✅ Yes | header-two |
|
H3 | ✅ Yes | header-three |
|
UL | ✅ Yes | unordered-list-item |
only support for continuous list |
OL | ✅ Yes | ordered-list-item |
only support for continuous list |
Equation | ✅ Yes | MATH |
using katex for rendering |
Image | ❌ Missing | ||
Table | ❌ Missing | ||
Code Snippet | ❌ Missing |
Not support overlapping styles.
npm i @zhyd1997/draftjs-to-latex
# yarn
yarn add @zhyd1997/draftjs-to-latex
Only support ES6:
import { scan } from "@zhyd1997/draftjs-to-latex";
const generatedTex = scan(contentState);
// console.log(generatedTex);
npm install
npm test