Skip to content

nehan plugin for displaying mathematical expression using katex

License

Notifications You must be signed in to change notification settings

tategakibunko/nehan-katex

Repository files navigation

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.

About

nehan plugin for displaying mathematical expression using katex

Topics

Resources

License

Stars

Watchers

Forks

Packages