| 1 |
<!doctype html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta charset='utf-8'> |
| 5 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css"> |
| 6 |
<link rel="stylesheet" href="../css/texmath.css"> |
| 7 |
<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"></script> |
| 8 |
<script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js"></script> |
| 9 |
<script src="../texmath.js"></script> |
| 10 |
<title>beg_end test</title> |
| 11 |
</head> |
| 12 |
<body> |
| 13 |
<div id="out"></div> |
| 14 |
<script> |
| 15 |
const str = |
| 16 |
`"Euler\'s identity |
| 17 |
|
| 18 |
\\begin{equation} |
| 19 |
e^{i\\pi}+1=0 |
| 20 |
\\end{equation} |
| 21 |
|
| 22 |
$$ |
| 23 |
e^{i\\pi}+1=0 |
| 24 |
$$ |
| 25 |
|
| 26 |
\\begin{equation} |
| 27 |
\\begin{pmatrix} |
| 28 |
A & B \\\\ B & C |
| 29 |
\\end{pmatrix} |
| 30 |
\\end{equation} |
| 31 |
|
| 32 |
|
| 33 |
is a beautiful $a^2+b^2=c^2$ formula."` |
| 34 |
document.addEventListener("DOMContentLoaded", () => { |
| 35 |
const md = markdownit({html:true}).use(texmath, { engine: katex, |
| 36 |
delimiters: ["dollars","beg_end"] |
| 37 |
}); |
| 38 |
out.innerHTML = md.render(str); |
| 39 |
// console.log(md.render(str)) |
| 40 |
}) |
| 41 |
</script> |
| 42 |
</body> |
| 43 |
</html> |