1.0.0-6 • Published 6 years ago

@gerhobbelt/mathjax-third-party-extensions v1.0.0-6

Weekly downloads
5
License
Apache-2.0
Repository
github
Last release
6 years ago

mathjax-third-party-extensions

A list of MathJax extensions provided by third-party contributors.

Note The old version of this repository was retired alongside the MathJax CDN; see #39.

Third Party Extensions

  • arabic.js
    • TeX input extension that provides basic Arabic support.
  • mhchem
    • TeX input extension for typesetting chemical equations, by the maintainer of the original mhchem LaTeX package.
  • img
    • TeX input extension for using images
  • xyjax
    • TeX input extension for typesetting xypic diagrams.
  • siunitx
    • TeX input extension implementing much of the siunitx LaTeX package.
  • physics
    • TeX input extension implementing much of the physics LaTeX package.

Legacy extension

You can find older (unmaintained) extensions in the legacy folder of this repository.

Contributing

Add your extension! Simply create a pull request adding a link to README.md.

Please structure your extension along the lines of existing third-party extensions. In particular, make sure that

  • Add a README file
    • Include basic usage information for your extension (see other extensions for inspiration).
  • Add a license.
    • We require Apache-license-2-compatible licenses.
  • Custom path in loadComplete call
    • The loadComplete call in your extension should be of the form [myextension]/filename.js to work generically with third party locations.
    • Note a clash of your prefix with another extension's prefix will usually mean that people can't use both extensions at the same time.
  • Tag it!
    • individual releases allow version specific loading from CDN providers.

We also suggest submitting your extension to cdnjs and jsdelivr -- and of course there's always rawgit.com.

Using third party extensions.

For more details, see the MathJax documentation.

A) Specify the path, e.g.,

<script type="text/x-mathjax-config">
  MathJax.Ajax.config.path["spiffy"] = "https://path/to/spiffy";
</script>

or equivalently,

<script type="text/javascript">
  window.MathJax = {
    AuthorInit: function () {
            MathJax.Ajax.config.path["spiffy"] = "https://path/to/spiffy";
        }
  };
</script>

B) Add the extension to your configuration, e.g.,

MathJax.Hub.Config({
  extensions: ["[spiffy]/spiffy.js"]
});

Writing extensions

The MathJax documentation contains a tutorial on extension writing.

Afterwards, you might want to start by looking at some of the extensions here and the MathJax core extensions.

Building / Regenerating extensions

npm install

# remove old cruft:
npm run clean

# implies a rebuild
npm test

Note that the MathJax-siunitx extension has its own package.json, which you must update separately when newer releases of npm packages become available, but for (re)building siunitx from scratch, all you need is invocing npm run clean; npm test in the base directory.