I have set up MathJax to load from my server and concatenated it with my other JS assets in order to boost performance. Initially, when I loaded the source file from the MathJax vendor directory, everything worked smoothly:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
},
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
<script src="http://example.com/assets-raw/vendor/MathJax/MathJax.js" ></script>
However, after minifying and concatenating MathJax.js
with my other assets, the combined JS file is now located in a different directory:
<script src="http://example.com/assets/js/minified.js" ></script>
The issue arises because MathJax can no longer locate files such as config.js
and tex2jax.js
along with its dependencies. It appears that MathJax relies on a default directory structure where these files are expected to be found.
In MathJax's documentation, they mention statements like
The default directory is
MathJax/extensions/
However, there seems to be no clear instruction on how to override this default setting through MathJax's configuration. Is it even possible to do so?