Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 857 Bytes

README.md

File metadata and controls

37 lines (26 loc) · 857 Bytes

nehan-katex

nehan plugin for displaying mathematical expression using katex",

demo

create nehan style

import { PagedNehanDocument, CssStyleSheet } from 'nehan';
import * as KatexStyle from 'nehan-katex';

const katexStyle: CssStyleSheet = KatexStyle.create({
  selector: "math"
});

const pd = new PagedNehanDocument("<math>$begin{pmatrix} a & b $$ c & d $end{pmatrix}</math>", {
  styleSheets:[
    katexStyle, // add katex style!
  ]
});

load katex css

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.0/katex.min.css">

use markup

<math class="inline">$sin</math> is called "正弦" in Japanese.
<math>$begin{pmatrix} a & b $$ c & d $end{pmatrix}</math>

Note that we use $ instead of \ in katex syntax.