How can I replace Matjax script with Katex script on blogger?

烈酒焚心 提交于 2019-12-12 03:26:57

问题


I have a website that is using many equation 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 Java

http://imgur.com/IRlx4oT

I want a Katex script to replace this MatJax script to work with my blog without making any modification. I have the latex 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.


回答1:


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>

and add

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

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>



回答2:


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. For example I am using ν symbo (not /nu). Is there any way to make Katex render greek symbols, please. Thank you. You have been of unexpected help.



来源:https://stackoverflow.com/questions/36555159/how-can-i-replace-matjax-script-with-katex-script-on-blogger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!