cryogen-project / cryogen

A simple static site generator written in Clojure
http://cryogenweb.org/
Eclipse Public License 1.0
1.09k stars 96 forks source link

MathJax integration #240

Closed BuddhiLW closed 2 years ago

BuddhiLW commented 3 years ago

Hello, greetings!

I'm using cryogen for my website www.buddhilw.com and I use a lot of LaTeX in my annotations.

I have put MathJax into base.html,

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

Just as is customary [https://www.mathjax.org/#gettingstarted](in the MathJax documentation.) But, then, my website do not properly renders equations. Is there any known bug, or solution to rendering LaTeX in Cryogen?

holyjak commented 2 years ago

No idea. Given it is a JS library, it has little to do with the backend code. You need to dig into the problem in the frontend, I guess. Could the async be causing the problems, the script being loaded too late??

BuddhiLW commented 2 years ago

I found the following from MathJax documentation. Likely, it would be great to adapt or write a Cryogen Plug-in as other content-management systems have. But, that is only a feature request, it's unlikely someone will do it immediately.

Interactions with Content-Management Systems

Such systems need to be told not to modify the mathematics that appears between math delimiters. That usually involves modifying the content-management system itself, which is beyond the means of most page authors. If you are lucky, someone else will already have done this for you, and you may be able to find a MathJax plugin for your system using a web search.

https://docs.mathjax.org/en/latest/input/tex/html.html#interactions-with-content-management-systems