0

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 Java

https://i.stack.imgur.com/5eAh6.jpg

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.

MattAllegro
  • 6,455
  • 5
  • 45
  • 52
user36636
  • 19
  • 5

2 Answers2

0

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>
YakovL
  • 7,557
  • 12
  • 62
  • 102
  • it is working with this script if I have the equation between
    ....
    – user36636 Apr 15 '16 at 16:59
  • 1
    If I have the $...$ your rendering script is no good. Can you tell how can I modify the first script to work with $...$ signs? – user36636 Apr 15 '16 at 17:04
  • @user36636 , can you provide some live example of what you have tried so I can see why it has failed? – YakovL Apr 16 '16 at 16:38
  • Is working now, just that https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/auto-render.min.js is in fact https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/contrib/auto-render.min.js" – user36636 Apr 16 '16 at 18:16
  • @user36636 Could you please finish the phrase so that others can understand what was wrong? – YakovL Apr 16 '16 at 18:18
  • 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 (nu /nu. Is there any way to make Katex render greek symbols, please. Thank you. You have been of unexpected help. – user36636 Apr 16 '16 at 18:19
  • What was wrong was the path to the scrript source . It is not but – user36636 Apr 16 '16 at 18:21
  • I just finished the comment by adding an answer. – user36636 Apr 16 '16 at 18:24
  • @user36636 right, I've misread your comment, my bad. Consider upvoting/accepting the answer if it was helpful (I'll fix the path there so that others will find the correct answer quickly) – YakovL Apr 16 '16 at 19:03
  • Yes Yakovl, thank you.Though katex does accept greek fonts using this scrpt here https://github.com/Khan/KaTeX/pull/410/files, by kevinbarabash. I just do not know how to use it, yet togehter with your script. – user36636 Apr 17 '16 at 19:40
0

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.

user36636
  • 19
  • 5