units

The units extension implements the units style package from LaTeX, which defines the \nicefrac, \unitfrac and \units macros. See the units CTAN page for more information and documentation.

Note

An implementation for MathJax of the siunitx LaTeX package is under development by a third party, and we hope to make it available soon.

This package is not autoloaded, so you must request it explicitly if you want to use it. To load the units extension explicitly, add '[tex]/units' to the load array of the loader block of your MathJax configuration, and add 'units' to the packages array of the tex block.

window.MathJax = {
  loader: {load: ['[tex]/units']},
  tex: {packages: {'[+]': ['units']}}
};

Alternatively, use \require{units} in a TeX expression to load it dynamically from within the math on the page, if the require extension is loaded.


units Options

Adding the units extension to the packages array defines an units sub-block of the tex configuration block with the following values:

MathJax = {
  tex: {
    units: {
      loose: false,
      ugly: false
    }
  }
};
loose: false

Determines whether fractions are loose (true) or tight (false), as described in the units documentation.

ugly: false

Determines whether fractions are ugly (true) or nice (false), as described in the units documentation.


units Commands

The units extension implements the following macros: \nicefrac, \unitfrac, \units