I've been randomly trying different things and I somewhat got this to work.
First off, I went to MathJax and LaTex instead of KaTex. I also used the example code for that C3 LaTeX thread.
main.js is standard except for this line
import * as MathJax from "./load-mathjax.js";
I can get LaTex to render right the first time I provide the CDN link. It won't work after that unless I change the CND link again. Is there some kind of a Cashe or some other one time only run setting?
load-mathjax.js
window.MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
svg: {
fontCache: 'global'
}
};
(function () {
var script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.1.4/es5/tex-chtml-full.js';
script.async = true;
document.head.appendChild(script);
})();
// script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML';