Package Exports
- markdown-it-texmath
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (markdown-it-texmath) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
markdown-it-texmath
Add TeX math equations to your Markdown documents rendered by markdown-it parser. KaTeX is used as a fast math renderer.
Features
Simplify the process of authoring markdown documents containing math formulas. This extension is a comfortable tool for scientists, engineers and students with markdown as their first choice document format.
- Simple formula numbering
- Inline math with tables, lists and blockquote.
- User setting delimiters:
'dollars'(default)- inline:
$...$ - display:
$$...$$ - display + equation number:
$$...$$ (1)
- inline:
'brackets'- inline:
\(...\) - display:
\[...\] - display + equation number:
\[...\] (1)
- inline:
'gitlab'- inline:
$`...`$ - display:
```math ... ``` - display + equation number:
```math ... ``` (1)
- inline:
Show me
View a test table.
Use with node.js
Install the extension. Verify having markdown-it and katex already installed .
npm install markdown-it-texmathUse it with JavaScript.
let kt = require('katex'),
tm = require('markdown-it-texmath').use(kt),
md = require('markdown-it')().use(tm,{delimiters:'brackets'});
md.render('Euler\'s identity \(e^{i\pi}+1=0\) is a beautiful formula.')Use in Browser
<html>
<head>
<meta charset='utf-8'>
<link rel="stylesheet" href="katex.min.css">
<link rel="stylesheet" href="texmath.css">
<script src="markdown-it.min.js"></script>
<script src="katex.min.js"></script>
<script src="texmath.js"></script>
</head>
<body>
<div id="out"></div>
<script>
let md;
document.addEventListener("DOMContentLoaded", () => {
const tm = texmath.use(katex);
md = markdownit().use(tm);
out.innerHTML = md.render('Euler\'s identity $e^{i\pi}+1=0$ is a beautiful formula.');
</script>
</body>
</html>CDN
Use following links for texmath.js and texmath.css
https://gitcdn.xyz/cdn/goessner/markdown-it-texmath/master/texmath.jshttps://gitcdn.xyz/cdn/goessner/markdown-it-texmath/master/texmath.css
Dependencies
markdown-it: Markdown parser done right. Fast and easy to extend.katex: This is where credits for fast rendering TeX math in HTML go to.
ToDo
- Integrate
markdown-it-texmathintomdmath.
License
markdown-it-texmath is licensed under the MIT License