Using KaTex in Ghost

I would like to use KaTex to type math equation in ghost, But I have absolute no idea how to start? I’m not sure which code to paste where in the code injection or in post.

Can anybody help me?

I would love to start a blog for my students.

1 Like

I’m not familiar with KaText - but if it supports embeds, you can paste their embed code into an HTML card in the Ghost editor.

@Rodhirejab There’s a tutorial here for how to use Code Injection to load the KaTex scripts https://www.naut.ca/blog/2019/04/01/quickly-add-latex-math-rendering-to-a-ghost-blog/.

THIS WORKS!!!

THANKS!!!

:grin:

UPDATE: just follow the same tutorial. and use this code instead. The Naut blog is using katex 0.10.1.
This code is Katex 0.15.2 (newer)

<!DOCTYPE html>
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
<html>
  <head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.css" integrity="sha384-MlJdn/WNKDGXveldHDdyRP1R4CTHr3FeuDNfhsLPYrq2t0UBkUdK2jyTnXPEK1NQ" crossorigin="anonymous">

    <!-- The loading of KaTeX is deferred to speed up page rendering -->
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.js" integrity="sha384-VQ8d8WVFw0yHhCk5E8I86oOhv48xLpnDZx5T9GogA/Y84DcCKWXDmSDfn13bzFZY" crossorigin="anonymous"></script>

    <!-- To automatically render math in text elements, include the auto-render extension: -->
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"
        onload="renderMathInElement(document.body);"></script>
  </head>
 
</html>
1 Like