使用editor.md编辑器写markdown和latex公式

2017-03-05 79305640 0

使用katex解析Latex公式,首先引入相应资源

  1. <link href="//cdn.bootcss.com/KaTeX/0.7.1/katex.min.css" rel="stylesheet">
  2. <script src="//cdn.bootcss.com/KaTeX/0.7.1/katex.min.js"></script>
  3. <script src="//cdn.bootcss.com/KaTeX/0.7.1/contrib/auto-render.min.js"></script>

需要注意以下几个地方:

  1. 行内公式,Latex使用$equation$来表示行内公式,不过在Katex中使用\(equation\)来表示。(在editor.md中使用$$

  2. 因为Markdown中\是转义字符,所以在Markdown中输入行内公式使用\\(equation\\)。其他地方如 \{, \\ 需要使用 \\{, \\\\来表示。

  3. 由于在markdown中 _ 表示 em 标签,故在Latex使用下标时需要使用 \_