使用editor.md编辑器写markdown和latex公式
使用katex解析Latex公式,首先引入相应资源
<link href="//cdn.bootcss.com/KaTeX/0.7.1/katex.min.css" rel="stylesheet">
<script src="//cdn.bootcss.com/KaTeX/0.7.1/katex.min.js"></script>
<script src="//cdn.bootcss.com/KaTeX/0.7.1/contrib/auto-render.min.js"></script>
需要注意以下几个地方:
行内公式,Latex使用
$equation$
来表示行内公式,不过在Katex中使用\(equation\)
来表示。(在editor.md中使用$$
)因为Markdown中
\
是转义字符,所以在Markdown中输入行内公式使用\\(equation\\)
。其他地方如\{, \\
需要使用\\{, \\\\
来表示。由于在markdown中
_
表示 em 标签,故在Latex使用下标时需要使用\_
。