简体   繁体   English

如何用博主上的 Katex 脚本替换 Matjax 脚本?

[英]How can I replace Matjax script with Katex script on blogger?

I have a website that is using many equations together with MathJax.我有一个网站,它与 MathJax 一起使用了许多方程。 Until now I found just a single MathJax script that is working on my blog.到目前为止,我只发现了一个可以在我的博客上运行的 MathJax 脚本。 The script that I have now is我现在拥有的脚本是爪哇

http://imgur.com/IRlx4oT http://imgur.com/IRlx4oT

I want a KaTeX script to replace this MathJax script to work with my blog without making any modification.我想要一个 KaTeX 脚本来替换这个 MathJax 脚本,以便在不做任何修改的情况下与我的博客一起工作。 I have the LaTeE part written between $...$ .我在$...$之间写了 LaTeE 部分。 I will appreciate a simple script that has the .js file already hosted.我会欣赏一个简单的脚本,它已经托管了 .js 文件。 A script that I can copy-paste to my blogger site and work.一个脚本,我可以复制粘贴到我的博客网站并工作。 Can you advise please?你能建议吗? Thank you.谢谢。

According to docs, you should first install KaTeX like this:根据文档,您应该首先像这样安装 KaTeX:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.js"></script>

and then install the Auto-render extension , presumably like this:然后安装Auto-render extension ,大概是这样的:

<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/contrib/auto-render.min.js"></script>

and add并添加

<script>renderMathInElement(document.body);</script>

to the end of the body element.到 body 元素的末尾。 See details on the page I've referenced (looks like you will need to set delimeters like this:查看我引用的页面上的详细信息(看起来您需要像这样设置分隔符:

<script>renderMathInElement(document.body,{delimiters:
  [{left: "$", right: "$", display: false}]
});</script>

What was wrong was the path to the scrript source .出问题的是脚本源的路径。 It is not它不是

<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/auto-render.min.js"></script>

but但是

<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/contrib/auto-render.min.js""></script>

Now I have another question: My site is containing many greek characters, in equations that are rendered with Matjax easily , but Katex is not good for this.现在我有另一个问题:我的网站包含许多希腊字符,在用 Matjax 轻松呈现的方程中,但 Katex 不适合这个。 For example I am using ν symbo (not /nu).例如,我使用 ν 符号(不是 /nu)。 Is there any way to make Katex render greek symbols, please.请问有什么办法可以让Katex渲染希腊符号。 Thank you.谢谢。 You have been of unexpected help.你得到了意想不到的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM