adityatelange / hugo-PaperMod

A fast, clean, responsive Hugo theme.
https://adityatelange.github.io/hugo-PaperMod/
MIT License
10.29k stars 2.73k forks source link

[Bug]: In the latest theme, some equations can not be rendered. #1634

Closed sherlcok314159 closed 3 days ago

sherlcok314159 commented 4 days ago

What happened?

When using the latest theme, it turns out that some equations can not be rendered while they can be rendered in my markdown file.

image

While my obsidian can render them all correctly:

image

Steps to reproduce

My katex file is as follows:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"
    onload="renderMathInElement(document.body, {
            delimiters: [
                {left: '$$', right: '$$', display: true},
                {left: '\\[', right: '\\]', display: true},
                {left: '$', right: '$', display: false},
                {left: '\\(', right: '\\)', display: false}
            ]
        });">
</script>

And the source text is as follows:

If we want to update the parameters, we need first to compute the partial derivative of $E(\boldsymbol{w})$ with respect to them.

$$
\frac{\partial E(\mathbf{w})}{\partial w_{kj}^{(2)}} = \frac{\partial E(\mathbf{w})}{\partial y_{k}} \frac{\partial y_k}{\partial w_{kj}^{(2)}} = (y_{k}- \hat{y}_k)z_{j} \tag{5.9}
$$

$$
\begin{align}
\frac{\partial E(\boldsymbol{w})}{\partial w_{ji}^{(1)}} &= \frac{\partial E(\boldsymbol{w})}{\partial h_{j}}\frac{\partial h_j}{\partial w_{ji}^{(1)}} = \left(\frac{\partial E(\boldsymbol{w})}{\partial z_{j}} \frac{\partial z_j}{\partial h_j}\right)x_{i} \tag{5.10}\\\
\end{align}
$$

$$
\frac{\partial E(\boldsymbol{w})}{\partial z_j} = \sum\limits_{k}\frac{\partial E(\boldsymbol{w})}{\partial y_{k}}\frac{\partial y_k}{\partial z_{j}}= \sum\limits_{k} (y_{k}- \hat{y}_{k}) w_{kj}^{(2)} \tag{5.11}
$$

$\text{Remark.}$ $z_j$ can send information to all the output neurons (e.g., $y_k$), thus we need to sum over all the derivatives with respect to $z_j$.

Substituting $\text{(4.11)}$ into $\text{(4.10)}$ we obtain

$$
\frac{\partial E(\boldsymbol{w})}{\partial w_{ji}^{(1)}} = (1 - z_j^2)x_{i} \sum\limits_{k} (y_{k} - \hat{y}_{k}) w_{kj}^{(2)} \tag{5.12}
$$

Hugo Version

Hugo >= 0.125.7 (Recommended - Minimum version required for PaperMod)

PaperMod Version

latest

What kind of devices are you seeing the problem on?

Desktop

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge

Browser Version

No response

Relevant log output

No

Repository/Source Code link where this issue can be reproduced

No response

Code of Conduct

sherlcok314159 commented 3 days ago

Close it for the bug is caused by the hugo not one specific theme.