Skip to content Skip to sidebar Skip to footer

Greek Fonts For Katex

I suceeded to use katex on my blog instead of MathJax. However some of the equations contained greek symbols and Katex does not contain the fonts for rendering the greek characters

Solution 1:

KaTeX doesn't currently support Greek letters as input, though as the comment says, \nu does work. See this issue for more details: Symbol unicode replacement doesn’t work

Solution 2:

Different formulae-rendering js libs behave in one of 3 different ways:

  • process \pi and tolerate π​​ (MathJax; MathQuill, although the result is somewhat different)
  • process \pi but don't tolerate π​​ (jsMath, KaTeX)
  • don't process \pi and tolerate π​​ (jqMath)

Unfortunately, like Ben has answered, KaTeX is not the one that tolerates raw greek characters. However, you may try to do some pre-parsing to "fix" this in a manner like this: before

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

add some "replace" stuff like desribed here (replace π with \pi and so on), although you should modify replaceTextOnPage function proposed there to replace all greek letters at once rather than launch a copy of replaceTextOnPage many times. You can do some other optimization since the solution there is somewhat general purpose but you know where to expect formulae on you pages.

Post a Comment for "Greek Fonts For Katex"