markdown-it-katex-newcommand
Plugin markdown-it for katex rendering with ability to add global \newcommand
Installation
yarn add markdown-it-katex-newcommand# or npm install markdown-it-katex-newcommand --save
Add CSS:
Basic
const md = ;const mkn = ;md;
## Add newcommands
Example:
const md = ;const mynewcommands = '\\displaystyle' +'\\newcommand{\\vect}[1]{\\overrightarrow{#1}}' +'\\newcommand{\\Oij}{\\left(O;\\vect{i};\\vect{j}\\right)}';const mkn = ;md;
## Katex
The native katex syntax also is supported:
const mymacroskatex = "\\f": "f(#1)";const mynewcommands = '\\newcommand{\\g}[1]{g\\left(#1\\right)}';const mkn = ;md