1. markdown-it-latex
Plugin for markdown-it, supports KaTex and AsciiMath.
markdown-it-latex
Package: markdown-it-latex
Created by: tylingsoft
Last modified: Sun, 19 Jun 2022 16:08:39 GMT
Version: 0.2.0
License: MIT
Downloads: 5,171
Repository: https://github.com/tylingsoft/markdown-it-latex

Install

npm install markdown-it-latex
yarn add markdown-it-latex

markdown-it-latex

Plugin for markdown-it, supports KaTex and AsciiMath.

Installation

yarn install markdown-it-latex

Usage

for node.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:

 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

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code