在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):waylonflinn/markdown-it-katex开源软件地址(OpenSource Url):https://github.com/waylonflinn/markdown-it-katex开源编程语言(OpenSource Language):JavaScript 87.1%开源软件介绍(OpenSource Introduction):markdown-it-katexAdd Math to your Markdown KaTeX is a faster alternative to MathJax. This plugin makes it easy to support in your markdown. Need convincing?
UsageInstall markdown-it
Install the plugin
Use it in your javascript var md = require('markdown-it')(),
mk = require('markdown-it-katex');
md.use(mk);
// double backslash is required for javascript strings, but not html input
var result = md.render('# Math Rulez! \n $\\sqrt{3x-1}+(1+x)^2$'); Include the KaTeX stylesheet in your html: <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css"> If you're using the default markdown-it parser, I also recommend the github stylesheet: <link rel="stylesheet" href="https://cdn.jsdelivr.net/github-markdown-css/2.2.1/github-markdown.css"/>
md.use(mk, {"throwOnError" : false, "errorColor" : " #cc0000"}); ExamplesInlineSurround your LaTeX with a single
BlockUse two (
SyntaxMath parsing in markdown is designed to agree with the conventions set by pandoc:
Math Syntax SupportKaTeX is based on TeX and LaTeX. Support for both is growing. Here's a list of currently supported functions: |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论