Fusion of # MathJax and Markdown A few days ago, the author USES Tian Shaohan personal blog (https://www.shaohanyun.top/posts/env/hugo_mathjax/), in strict accordance with the above instructions configuration, But in the coder theme his blog says’ extend_head.html ‘is’ head.html’ under my coder theme, which doesn’t matter.

Modify the configuration using the coder theme Link to heading

I remember coder’s example URL mentioned using KaTeX to render formulas, but never found it, so I fed its github URL to the ai, who told me, Add a line of code directly to [para] in ‘hugo.toml’

#[params](Locate here)
math = true
` ` `
That's it. Then you can display the formula in your blog, like this:

$$
\varTheta''+\cot\theta\varTheta'+\left[n(n+1)-\frac{m^2}{\sin^2\theta}\right]\varTheta=0
$$

Or the following

$$
y_2=\sum_{m=0}^{\frac{n-1}{2}}(-1)^m\frac{(2n-2m-1)! }{2^nm! (n-m)! (n-2m-1)! }x^{n-2m}
$$

Or it could be this formula



Some things to note:
- This is markdown, so you can't use the formula too casually like $\LaTeX$, such as the above paragraph, if written
```markdown
$$
\varTheta''+\cot\theta\varTheta'+\left[n(n+1)-\frac{m^2}{\sin^2\theta}\right]\varTheta=0
$$
Or the following
$$
y_2=\sum_{m=0}^{\frac{n-1}{2}}(-1)^m\frac{(2n-2m-1)! }{2^nm! (n-m)! (n-2m-1)! }x^{n-2m}
$$
` ` `
The following results are displayed
> $$
\varTheta''+\cot\theta\varTheta'+\left[n(n+1)-\frac{m^2}{\sin^2\theta}\right]\varTheta=0
$$
Or the following
$$
y_2=\sum_{m=0}^{\frac{n-1}{2}}(-1)^m\frac{(2n-2m-1)! }{2^nm! (n-m)! (n-2m-1)! }x^{n-2m}
$$
This mistakenly turns the text into a formula, and the formula that should be rendered is rendered in source form instead.
```markdown
$$
\varTheta''+\cot\theta\varTheta'+\left[n(n+1)-\frac{m^2}{\sin^2\theta}\right]\varTheta=0
$$

Or the following

$$
y_2=\sum_{m=0}^{\frac{n-1}{2}}(-1)^m\frac{(2n-2m-1)! }{2^nm! (n-m)! (n-2m-1)! }x^{n-2m}
$$
` ` `
It can be displayed correctly.
- KaTeX functionality is still limited, it does not seem to support the type of line wrap enclosed in braces, and it may take a long time to render some extremely complex formulas, such as the following (you should see the source code, it is estimated that it is too large to render).

$$
K_n(x)=\frac{1}{2}\sum_{m=0}^{n-1}\frac{(-1)^m(n-m-1)! }{m! }\left(\frac{x}{2}\right)^{2m-n}+(-1)^{n+1}\sum_{m=0}^{+\infty}\frac{\left(\frac{x}{2}\right)^{n+2m}}{m! (n+m)! }\left[\ln \frac{x}{2}-\frac{1}{2}\varPsi (m+1)-\frac{1}{2}\varPsi(n+m+1)\right]

$$

Therefore, the place to hit the formula or use $\LaTeX$, KaTeX is not the best choice to hit the formula, can only be said to hit the optimal solution on the web page.