I’d like to use the goldmark-mathjax extension on my site, but I’m not sure where to start on installing it — I presumably have to install the extension and somehow tell hugo how to find it, but I have no idea where to start. Could anyone give me a hint?
That comment does not jive with my experience. When I insert a display math, e.g.
$$
\begin{vmatrix}a & b\\
c & d
\end{vmatrix}
$$
It no longer displays correctly (once processed by MathJax) because the markdown -> html translation has inserted additional tags.
i.e. awwong’s claim is incorrect: as well as wrapping the result in html tags (unimportant) it also ensures that the contents of the display math block are not treated as markdown (very important). More precisely, plain goldmark transforms the above into:
$$
\begin{vmatrix}a & b\<br>
c & d
\end{vmatrix}
$$
The main problem is that \\ has turned into \, so there is no longer a second line in the matrix.
To use the goldmark-mathjax extension you would need to fork Hugo, modify its source and compile the binary on your own.
This is no easy task.
However if you still prefer to follow this route, there has been at least one rejected Pull Request -with that particular extension- at the main Hugo repo, that you can use as a blueprint .
Thanks for carrying this one forward @jph00. Your hugo fork looks like a step forward in that it is good to have a proof-of-concept. In practice I imagine it is going to be tough to get non-standard hugo builds on all the machines used for our group blog; How have you found that process?
We’re only just starting on this, so I don’t have any experience to report. Our plan, if Hugo doesn’t add the extension directly, is to auto-download the patched version automatically as part of the nbdev make process. We’re currently using GitHub Actions to automatically build (and upx-compress, and release) the patched version every day.
Will that approach have the issues with _? Or any other issues of MarkDown parsing of LaTeX code?
Update
It does. It seems setting a short code with {{ .Inner }} is basically a way to escape MarkDown parsing. right?
Is the a way to use short code to define the MathJaX span as uses by the GoldMark MathJaX extension?