Use goldmark-mathjax extension

right,

Hugo knows nothing about LaTex. You have to write all markdown and templates to produce correct LaTex output.

If you have a solution, fine. Let’s stop here.

We cannot stop this, unfortunately…

Your example works with the {{ .inner }} template.
Do you have an example which breaks it?

I meant this (using replaceRE): my comment Use goldmark-mathjax extension

The math shortcode is ok. I have compared two output between the math shortcode (using .Inner) and my workaround (using replaceRE ). My workaround broke other elements on other pages with my theme.

What are the shortcomings of the {{ .inner }} approach vs. the GoldMark MathJaX Extension (GME? :-)) in your opinion?

The shortcode approach works but all theme need to create a shortcode for mathjax/katex. So goldmark-mathjax extension is the best solution if Hugo can get it, I think.

3 Likes

If you have many existing markdown files written with other editor you need to change every equation in every markdown file if you use the short code approach. If hugo can automtically handle that it would be wonderful.

1 Like

I totally agree, I also wants out of the box support for MathJaX.
Any progress on that front?