/MathJax-siunitx

MathJax extension that emulates the great LaTeX package `siunitx` by Joseph Wright

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Extension: siunitx for the MathJax third party repository

An implementation of the siunitx package for LaTeX for MathJax.

#About siunitx

The siunitx package allows to typeset physical quantities consistently using the syntax \SI{299e6}{\metre\per\second}. This extension provides the same syntax in MathJax. Please see the documentation for siunitx on CTAN for details about siunitx.

References:

Using this extension

Since the shutdown of the MathJax CDN, this extension is not currently hosted on any CDN. When using it in a production environment, please host it locally. To try it out, you may use rawgit. Then, add the extension to your configuration like any other third party extension. For example, your inline configuration might be

 <script type="text/x-mathjax-config>
 MathJax.Hub.Config({
   extensions: ["tex2jax.js","[siunitx]/siunitx.js"],
   jax: ["input/TeX","output/HTML-CSS"],
   tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
   TeX: {extensions: ["AMSmath.js","AMSsymbols.js", "sinuitx.js"]}
 });
 MathJax.Ajax.config.path['siunitx']  = 'http://rawgit.com/burnpanck/MathJax-siunitx/master/';
 </script>

Example

We have a listing of extracted code samples from the siunitx documentation (see it live) that highlight a number of uses of this extension and provides static images rendered with pdflatex and the siunitx package for comparison. For debugging purposes, you may append ?unpacked or ?modular to the URL, making the page use the combined but not minified, or even the modular original sources instead of the production level minified version of the extension.