Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@springernature/mathjax-config

0.2.1 • Public • Published

mathjax-config

MathJax takes inline MathML, TeX and ASCIImath code, and transform it into high-quality scalable equations.

This repo contains configurations and setup scripts for enabling Mathjax on Springer Nature content delivery platforms.

Usage

Including this script in your site will load Mathjax from a CDN, load the included SN configuration options, and apply Mathjax to any inline equations on your page.

Expected HTML

There's no need for specially-formatted HTML. Once loaded, Mathjax will look for inline-equations in the form of:

<p>This is normal text \({}^{132}\hbox {Xe}\). And more normal text.</p>

or

<h1>This is normal text \({-\Delta(-\Delta u+W^{\prime}(u))+W^{\prime\prime}(u)(-\Delta u+W^{\prime}(u))=0}\) and more normal text.</h1>

Installation via npm

mathjax-config is published as a package on npm.

To install via npm:

$ npm install @springernature/mathjax-config --save

or with Yarn:

$ yarn add @springernature/mathjax-config

In your Javascript file import the module.

In ES6 syntax:

import MathJaxConfig from '@springernature/mathjax-config';

In ES5 syntax:

const MathJaxConfig = require('@springernature/mathjax-config');

Then initialise the module:

MathJaxConfig.loadMathJaxAsync();

The main Mathjax library will now be loaded asynchronously from a CDN and will convert any inline equations it finds on the page.

Installation via Browserify

Check the examples directory for how to include this package to your project using node-browserify.

To run the example, run:

npm run browserify-example

This will generate a main.js file. Then just open example.html on your browser to see MathJax in action.

Install

npm i @springernature/mathjax-config

DownloadsWeekly Downloads

22

Version

0.2.1

License

none

Unpacked Size

19.8 kB

Total Files

7

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar