如何在Blogger上用Katex脚本替换Matjax脚本? [英] How can I replace Matjax script with Katex script on blogger?
问题描述
我有一个与MathJax一起使用许多方程式的网站.到目前为止,我只在我的博客上找到了一个MathJax脚本.我现在拥有的脚本是
I have a website that is using many equations together with MathJax. Until now I found just a single MathJax script that is working on my blog. The script that I have now is
我希望KaTeX脚本替换此MathJax脚本以使其与我的博客一起使用,而无需进行任何修改.我在$...$
之间编写了LaTeE部分.
我将欣赏一个简单的脚本,该脚本已经托管了.js文件.我可以将其复制粘贴到博客站点并可以工作的脚本.
你能告诉我吗?
谢谢.
I want a KaTeX script to replace this MathJax script to work with my blog without making any modification. I have the LaTeE part written between $...$
.
I will appreciate a simple script that has the .js file already hosted. A script that I can copy-paste to my blogger site and work.
Can you advise please?
Thank you.
推荐答案
根据文档,您应该首先这样安装KaTeX:
According to docs, you should first install KaTeX like this:
<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:
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/contrib/auto-render.min.js"></script>
并添加
<script>renderMathInElement(document.body);</script>
到body元素的末尾.在我所参考的页面上查看详细信息(看起来您将需要像这样设置分度符:
to the end of the body element. 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>
这篇关于如何在Blogger上用Katex脚本替换Matjax脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!