Using katex library to render Math formulas
How to configure your web page to render formulas using the Katex library
Using KATEX on your site is incredibly simple.
Place the following lines of code in the section of your HTML code.
CSS
KATEX Core
KATEX Autorender
At the bottom of the page, just above the body
tag, paste this JavaScript code that will set the environment.
Now insert the formulas between '$$'. Everything between these two dollar signs will be rendered by the KATEX engine.
Here are two examples:
$$ c = \pm\sqrt{a^2 + b^2} $$
and
$$ \int f(x) dx $$
will be displayed on the page as:
$$ c = \pm\sqrt{a^2 + b^2} $$
and
$$ \int f(x) dx $$
respectively.
Other examples:
\def\arraystretch{1.5} \begin{array}{c:c:c} a & b & c \\ \hline d & e & f \\ \hdashline g & h & i \end{array}
$$\def\arraystretch{1.5} \begin{array}{c:c:c} a & b & c \\ \hline d & e & f \\ \hdashline g & h & i \end{array}$$
and
\begin{bmatrix} a & b \\ c & d \end{bmatrix}
$$ \begin{bmatrix} a & b \\ c & d \end{bmatrix} $$
This is how we use KATEX on this site (questiun.com).