CHENXCHEN / hexo-renderer-markdown-it-plus

Markdown-it is a markdown parser, done right. A faster and CommonMark compliant alternative for Hexo.
https://chchc.me/hexo-article/2017/07/27/hexo-renderer-markdown-it-plus-plugin-demo/
MIT License
115 stars 22 forks source link

如何更换公式的渲染? #18

Closed inkss closed 4 years ago

inkss commented 6 years ago

你好,我先在配置里把 markdown-it-katex 关掉了:


```markdown_it_plus:
    highlight: true
    html: true
    xhtmlOut: true
    breaks: true
    langPrefix:
    linkify: true
    typographer:
    quotes: “”‘’
    plugins:
        - plugin:
            name: '@iktakahiro/markdown-it-katex'
            enable: false

然后安装了 hexo-math ,但是发现文章公式部分并没有渲染,请问如何解决呢?

fuhailin commented 5 years ago

Have you solved this problem? I get a similar situation. I want to use "hexo-renderer-kramed": "^0.1.4", but "hexo-renderer-markdown-it": "^3.4.1" render LaTex conflicted with hexo-renderer-kramed.

inkss commented 5 years ago

@fuhailin 没有替换,安装完插件后,不需要改动配置,只需要对主题文件稍作修改:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0-rc.1/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0-rc.1/dist/katex.min.js"></script>

将以上两行加入到网页的 head 标签里。此外,这里对公式渲染使用的是 KaTex 而非 LaTex 。

MakerGYT commented 4 years ago

试试markdown-it-latex2img