r/IPython • • May 06 '20

preloading MathJax extensions

I'm trying to preload cancel.js for every notebook instead of using \require.

The MathJax 2.7 docs say:

To use this extension in your own configurations, add it to the extensions array in the TeX block.

TeX: {
  extensions: ["cancel.js"]
}

This extension is not included in any of the combined configurations, and will not be loaded automatically, so you must include it explicitly in your configuration if you wish to use these commands.

So I put in my custom.js inside MathJax.Hub.Config({}), which does work for other customizations like displayAlign:left. But it doesn't work and I still have to \require it.

Then I see in extensions/Safe.js:

MathJax.Hub.CombineConfig("Safe", {
    allow: {
    ...
      require: "safe"
    },
    safeRequire: {
      ...
      cancel: true

Is that interfering with explicit preloading? I don't think so.

3 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/harper357 May 06 '20

Not sure, but once you install an extension it will load for all your notebooks. I don't know what exact version MathJax Jupyter normally uses, but I've had problems with MathJax rendering in the past so I switched and never looked back.