Questions for Brad and Rob.
- latex packages
- latex macros
into the actual MathJax configuration for pages. Rather than \require'ing packages and defining macros in some special span of math content. I have it working for a regular HTML build and for Jupyter.
In the Runestone manifest, there is a "latex-macros" element which has text content, specifically the \require'ing of any packages, and the definitions of all latex macros. Within Runestone, say some exercise needs to be used. The ambient RS page uses the content of "latex-macros" with a hidden div to load all that stuff inside math content delimiters.
Are you interested in moving to the approach where these things are in the MJ config? An outline of the change (which is identical for MJ3 and MJ4) is that the manifest "latex-macros" element would be structured like this:
latex-macros: {
packages: ['package1', 'package2', ... ],
macros: <a multiline string defining all the macros>
}
Then in the Runestone page, where the MathJax config is set up, it would be altered appropriately to load these packages and define these macros.
For Rob, I am also aware now that similar adjustment would be
needed for math extraction and Sage Math Cloud/Cocalc. I've reviewed
those and it looks like things will work fine once I make the same changes. I'll check before opening any PR.
If anyone is wondering why I'm interested in this, it's more than just an OCD desire to put MJ configuration into the actual MJ configuration. The result would be that the window.MathJax variable "knows" what the packages and macro definitions are. Those can then be accessed from other things. In particular, an iframe that is loading a webwork exercise using the *WeBWorK server's MathJax* is able to access the parent window's MathJax variable, get that information, and load those things. Whereas presently we have to repeat all \require'ing and macro definition within each exercise.