Can I add LaTeX packages to MathJax?

A Person picture A Person · Jan 17, 2014 · Viewed 10.5k times · Source

I have some mathematical expressions written in LaTeX that I would like to put on a webpage. However, they use packages that don't seem to be included in MathJax (e.g. ytableau). They were sufficiently time consuming to write in the first place that I'd like to be able to use what I have, rather than figure out how to reproduce the results with the MathJax features I currently have access to.

I had thought that it may be easy to turn a LaTeX package into a MathJax extension as the extensions in the MathJax installation appear to be based on LateX packages, I looked at the cancel.sty LaTeX package and the cancel.js MathJax extension hoping it would give me some idea of how to do it but I can't see how they relate.

Is there a way of using LaTeX packages with MathJax? If so, how would I do this?

(First question, hope this is not deemed off topic.)

Answer

Davide Cervone picture Davide Cervone · Jan 17, 2014

Is there a way of using LaTeX packages with MathJax?

No. MathJax isn't LaTeX; it processes input that is LaTeX-like (as close as it reasonably can be to true LaTeX), but the way it works under the hood is very different. One difference in particular is that MathJax only implements the math-mode macros, not all the other text-mode or general processing macros and control sequences. So most of the tools used by LaTeX packages aren't there. That means you can not simply drop a LaTeX package into MathJax. The packages that MathJax supports have to be re-implemented in javascript, which is difficult for non-trivial packages (like the one you cite).