nehan plugin for displaying mathematical expression using katex
  • TypeScript 99.7%
  • Makefile 0.3%
Find a file
2021-04-25 06:44:21 +09:00
.gitignore First commit 2021-03-13 18:08:09 +09:00
.npmignore First commit 2021-03-13 18:08:09 +09:00
index.ts Inherit font from parent context but fontSize is original 2021-03-16 20:44:46 +09:00
LICENSE First commit 2021-03-13 18:08:09 +09:00
Makefile First commit 2021-03-13 18:08:09 +09:00
package-lock.json Updated katex 2021-04-25 06:44:21 +09:00
package.json 0.0.3 2021-03-16 20:45:16 +09:00
README.md Added screen shot 2021-04-06 08:20:21 +09:00
sshot.png Added screen shot 2021-04-06 08:19:46 +09:00
tsconfig.json First commit 2021-03-13 18:08:09 +09:00

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.