MathJax-docs icon indicating copy to clipboard operation
MathJax-docs copied to clipboard

What is the 'expandable' function?

Open christianp opened this issue 10 months ago • 1 comments

The page on the autoload extension uses a function called expandable in the MathJax config, e.g.:

MathJax = {
  tex: {
    autoload: expandable({
      color: []
    }
  }
};

What is this supposed to be?

The config is defined before MathJax has loaded, and expandable isn't a built-in. Is this just a mistake?

christianp avatar Apr 09 '25 08:04 christianp

Yes, expandable() should probably be removed from those examples. It is used for configuration objects where the property list is not limited to the ones given initially as the defaults. Since MathJax checks that the options you provide are valid ones (e.g. if you mistype a property name ,Mathjax will flag that), when a list of properties is allowed to have keys other than the default ones, that is makes by an expandable() list. The autoload list is one of those, since you can add in third-party packages, for example, so we don't want to flag values as invalid that are not in the initial list.

But there is no need for a user to include expandable() in their configuration, and so that should be removed from the documentation. It was probably accidentally included because the file that creates the autoload extension includes it.

Thanks for pointing that out.

dpvc avatar Apr 09 '25 11:04 dpvc