KaTeX Support

KaTeX Syntax for Markdown

In your Markdown content, use the katex shortcode for inserting KaTeX. Check documentation for Shortcode: katex.

Here’s an example Markdown content:

When {{< katex inline >}} a \ne 0 {{< /katex >}}, there are two solutions to

{{< katex >}} ax^2 + bx + c = 0 {{< /katex >}}

and they are:

{{< katex >}}
x = {-b \pm \sqrt{b^2-4ac} \over 2a}
{{< /katex >}}

Output:

When \( a \ne 0 \) , there are two solutions to

\[ ax^2 + bx + c = 0 \]

and they are:

\[ x = {-b \pm \sqrt{b^2-4ac} \over 2a} \]

Customize KaTeX Configuration

You can customize the default behavior of KaTeX if you want.

Minimo picks up configuration for KaTeX from the /data/config/katex.json file.

The default configuration options look like this:

{
  "library": {
    "js": {
      "main": "//unpkg.com/katex/dist/katex.min.js",
      "autoRender": "//unpkg.com/katex/dist/contrib/auto-render.min.js"
    },
    "css": {
      "main": "//unpkg.com/katex/dist/katex.min.css"
    }
  },
  "options": {}
}
  • library [Object]:
    • js [Object]:
    • css [Object]:
      • main [String]: URL for the main KaTeX stylesheet
  • options [Object]:

So, if you want to tinker with it’s configuration options:

  • Create a /data/config/katex.json file in your site’s repository
  • Copy the default configuration options
  • Start hacking

Thank You!

Your comment has been submitted. It will appear on this page shortly! OK

Yikes, Sorry!

Error occured. Couldn't submit your comment. Please try again. Thank You! OK

3 comments on KaTeX Support

  1. Vincent Tam's avatar Vincent Tam says:
    Test inline \(\KaTeX\) and block equations.

    $$ \sum_{n = -\infty}^\infty \frac{1}{(n + \alpha)^2} = \frac{\pi^2}{\sin^2(\pi\alpha)} \qquad \forall \alpha \notin \Z $$

    Leave a comment