I have been setup mathjax to help me render math formula.And now when i type a formula like this
$\alpha_t = \prod_{i=1}^t \alpha_i$,
Hugo server render correctly, but when i type formula like this $\bar{\alpha}_t = \prod_{i=1}^t \alpha_i$
, hugo doesn’t convert this text to math formula. Does anyone have the same problem, it’s really strange, hope anyone can discuss with me, thanks a lot😊
See the em element? That’s due to the underscores in the markdown.
fix (escape first underscore)
$\bar{\alpha}\_t = \prod_{i=1}^t \alpha_i$
Alternative
To prevent Hugo from rendering to HTML before Mathjax renders the math, use a shortcode or code block render hook. Here’s a small test site that demonstrates both:
git clone --single-branch -b hugo-forum-topic-41107 https://github.com/jmooring/hugo-testing hugo-forum-topic-41107
cd hugo-forum-topic-41107
hugo server
Thanks for your answer, it works for me
and debugging the rendering Html code way is really useful, I solved similar problems this way.
And here is my summary, hope is useful for others:
replace _{ to \_{
replace }_ to }_\
replace \\ to \\\