Only load Katex on pages with equations
-
Dear Mr. Churchman,
I personally prefer Katex to MathJax for my website, but Katex is added to every webpage even though most pages do not have any math displayed on them. This is also true for MathJax, but this problem can be eliminated by only having MathJax loaded for webpages displaying math with the following command sequence for displaying a Tek equation:
<script type="text/javascript" id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">; </script> <div style="font-size:22px">$$x = {-b pm sqrt{b^2-4ac} over 2a}.$$</div>
If you notice, MathJax is loaded from the https://cdn.jsdelivr.net server for every instance on a page when it is needed. Can this also be done for Katex? If so, what is the command sequence for the Quadratic Equation shown above to accomplish this?
Thanks in advance for your assistance.
Respectfully,
Scott
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Only load Katex on pages with equations’ is closed to new replies.