https://github.com/tylingsoft/markdown-it-latex
Plugin for markdown-it, supports KaTex and AsciiMath.
https://github.com/tylingsoft/markdown-it-latex
Last synced: about 1 year ago
JSON representation
Plugin for markdown-it, supports KaTex and AsciiMath.
- Host: GitHub
- URL: https://github.com/tylingsoft/markdown-it-latex
- Owner: tylingsoft
- Created: 2017-03-26T08:41:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T08:00:31.000Z (over 8 years ago)
- Last Synced: 2025-04-14T14:14:23.482Z (about 1 year ago)
- Language: CSS
- Size: 85.9 KB
- Stars: 16
- Watchers: 2
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# markdown-it-latex
Plugin for markdown-it, supports KaTex and AsciiMath.
## Installation
```
yarn add markdown-it-latex
```
## Usage
### for node.js
```js
import markdownIt from 'markdown-it'
import markdownItLatex from 'markdown-it-latex'
const mdi = markdownIt()
mdi.use(markdownItLatex)
mdi.render('`$E = mc^2$`')
mdi.render('`@(1/2[1-(1/2)^n])/(1-(1/2))=s_n@`')
mdi.render(`\`\`\`math
\oint_C x^3\, dx + 4y^2\, dy
\`\`\``)
mdi.render(`\`\`\`AsciiMath
oint_Cx^3 dx+4y^2 dy
\`\`\``)
```
### for browser
You also need to import the css:
```js
import 'markdown-it-latex/dist/index.css'
```
Or you can add the css to the web page directly.
## Development
### Build
```
yarn build:watch
```
### Test
```
yarn test
```
### Distribution
```
yarn release && npm publish
```
## Todo