I’m relatively new to Hugo, so apologies if it is a simple fix. I was trying to follow this thread (How to use the transform.ToMath function? - support - HUGO) to have purely server-side latex rendering and looked through the provided example repo in the solution.
I have set-up an example of my issue here ( pocofrosty/math-rendering-with-PaperMod-example: Testing MathJax with PaperMod Theme). I installed the PaperMod theme and added the stylesheet by overwriting the extend_head.html file and added the render-passthrough file.
When I localhost and select a post, I am able to see the latex rendered. On the other hand, from the main page, the summary of the post does not render properly (Confusingly, it duplicates it 3 times it seems). Using a manual summary from Hugo’s documentation didn’t seem to resolve this issue.
I think the relevant code to modify is in themes/PaperMod/layouts/_default/_list.html.
{{- if (ne (.Param "hideSummary") true) }}
<div class="entry-content">
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
</div>
{{- end }}