w:MathJax

{{Short description|Cross-browser JavaScript library that displays mathematical equations in web browsers}}

{{Infobox software

| name = MathJax

| logo = MathJax.svg

| developer = American Mathematical Society

| latest release version = 3.2.2{{cite web|url=https://github.com/mathjax/MathJax/releases/tag/3.2.2|title=MathJax v3.2.2|website=MathJax|date=2022-06-08}}

| latest release date = {{Start date and age|2022|06|08}}

| latest preview version = 4.0.0-beta.7{{cite web |title=Releases · mathjax/MathJax |url=https://github.com/mathjax/MathJax/releases/ |website=GitHub |access-date=9 March 2025 |language=en}}

| latest preview date = {{Start date and age|2024|07|21}}

| operating system = Cross-platform

| programming language = JavaScript

| genre = Mathematical software

| license = Apache License 2.0

| website =

}}

MathJax is a cross-browser JavaScript library that displays mathematical notation in web browsers, using MathML, LaTeX, and ASCIIMathML markup.{{cite web |url=http://ajaxian.com/archives/mathjax |title=MathJax: Rich Math display from LaTeX and MathML|date=17 November 2015}}{{cite web |url=http://docs.mathjax.org/en/latest/asciimath.html |title=MathJax AsciiMath support |access-date=2013-04-07 |archive-url=https://web.archive.org/web/20180323015930/http://docs.mathjax.org/en/latest/asciimath.html |archive-date=2018-03-23 |url-status=dead }}{{cite journal |title=What you need to know about the Maths Stack |first1=Autumn |last1=Cuellar |first2=Paul |last2=Topping |date=June 2013 |journal=XML London 2013 |doi=10.14337/XMLLondon13.Cuellar01 |url=http://xmllondon.com/2013/presentations/cuellar/ |pages=63–68 |doi-broken-date=2024-11-02 |isbn=978-0-9926471-0-0|editor1-last=Mathews |editor1-first=Bob |doi-access=free }} MathJax is released as open-source software under the Apache License.

The MathJax project started in 2009 as the successor to an earlier JavaScript mathematics formatting library, jsMath,{{citation |title=Writing Math on the Web: The Web would make a dandy blackboard if only we could scribble an equation |journal=American Scientist |first=Brian |last=Hayes |author-link=Brian Hayes (scientist) |volume=92 |issue=2 |year=2009 |page=98 |doi=10.1511/2009.77.98}}. and is managed by the American Mathematical Society.{{cite web |url=https://www.mathjax.org/ams-becomes-managing-partner-of-the-mathjax-consortium/ |title=AMS becomes managing partner of the MathJax Consortium|date=2013-03-20}} The project was founded by the American Mathematical Society, Design Science, and the Society for Industrial and Applied Mathematics and is supported by numerous sponsors such as the American Institute of Physics and Stack Exchange.{{cite web |url=https://www.mathjax.org/#sponsors |title=MathJax Sponsorship}}

MathJax is used by web sites including arXiv,{{cite web |url=https://arxiv.org/help/mathjax |title=arXiv.org help – What is MathJax?}} Elsevier's ScienceDirect,{{cite web |url=http://www.elsevier.com/physical-sciences/mathematics/mathjax |title=MathJax on ScienceDirect |access-date=2014-08-24 |url-status=dead |archive-url=https://web.archive.org/web/20140826121202/http://www.elsevier.com/physical-sciences/mathematics/mathjax |archive-date=2014-08-26 }} MathSciNet,{{cite web |url=https://www.ams.org/mathscinet/help/about.html |title=MathSciNet What's New}} n-category cafe, MathOverflow, Wikipedia (on the backend),{{cite book |last1=Schubotz |first1=Moritz |last2=Wicke |first2=Gabriel |date=2014-01-01 |chapter=Mathoid: Robust, Scalable, Fast and Accessible Math Rendering for Wikipedia |title=Intelligent Computer Mathematics |series=Lecture Notes in Computer Science |arxiv=1404.6179 |volume=8543 |pages=224–235 |doi=10.1007/978-3-319-08434-3_17 |isbn=978-3-319-08434-3|s2cid=16123116 }}{{Cite web |url=https://www.mediawiki.org/wiki/Extension:Math |title=Extension:Math - MediaWiki |website=www.mediawiki.org |language=en |access-date=2017-04-06}} Scholarpedia, Project Euclid journals,{{cite web |url=http://projecteuclid.org/DPubS?Service=UI&version=1.0&verb=Display&handle=euclid&page=about&aboutPage=about_mathjax&aboutArea=subscribers |title=What is MathJax?}} IEEEXplore,{{Cite web|title=IEEE Xplore Help|url=https://ieeexplore.ieee.org/Xplorehelp/|access-date=2021-08-05|website=IEEE}} Publons, Coursera, and the All-Russian Mathematical Portal.{{cite web |url=http://www.mathnet.ru/index.phtml/?option_lang=eng |title=All-Russian Mathematical Portal}}

Features

MathJax is downloaded as part of a web page, scans the page for mathematical markup, and typesets the mathematical information accordingly. Thus, MathJax requires no installation of software or extra fonts on the reader's system. This allows MathJax to run in any browser with JavaScript support, including mobile devices.{{citation | last =Cervone | first =Davide | title = Math Jax: A Platform for Mathematics on the Web | journal = Notices of the American Mathematical Society | volume = 59 | issue = 2 | pages = 312–316 | year = 2012 | url = https://www.ams.org/notices/201202/rtx120200312p.pdf | doi=10.1090/noti794| doi-access = free }}

MathJax can display math by using a combination of HTML and CSS or by using the browser's native MathML support, when available. The exact method MathJax uses to typeset math is determined by the capabilities of the user's browser, fonts available on the user's system, and configuration settings. MathJax v2.0-beta introduced SVG rendering.{{cite web|url=https://www.mathjax.org/mathjax-v2-0-beta-now-available-on-cdn/|title=MathJax v2.0-beta now available on CDN|date=February 11, 2012}}

In the case of HTML and CSS typesetting, MathJax maximizes math display quality by using math fonts if available and by resorting to images for older browsers. For newer browsers that support web fonts, MathJax provides a comprehensive set of web fonts, which MathJax downloads as needed. If the browser does not support web fonts, MathJax checks whether valid fonts are available on the user's system. If this does not work, MathJax provides images of any symbols needed.{{clarify|date=August 2012}} MathJax can be configured to enable or disable web fonts, local fonts, and image fonts.

MathJax uses the STIX fonts for including mathematics in web pages. Installing the fonts on the local computer improves MathJax’s typesetting speed.[http://www.mathjax.org/help/fonts/ MathJax Font Help] {{webarchive|url=https://web.archive.org/web/20120728051522/http://www.mathjax.org/help/fonts/ |date=2012-07-28 }} accessed 2012-08-14.

MathJax can display mathematical notation written in LaTeX or MathML markup. Because MathJax is meant only for math display, whereas LaTeX is a document layout language, MathJax only supports the subset of LaTeX used to describe mathematical notation.

MathJax also supports math accessibility by exposing MathML through its API to assistive technology software, as well as the basic WAI-ARIA "role" and older alt attributes.{{cite web|url=https://www.mathjax.org/#modal-zoom |title=MathJax: Accessibility}}

The MathJax architecture is designed to support the addition of input languages and display methods in the future via dynamically loaded modules. MathJax also includes a JavaScript API for enumerating and interacting with math instances in a page.

Browser compatibility

MathJax renders math in most popular browsers, including Internet Explorer 6+, Firefox 3+, Google Chrome 0.3+, Safari 2.0+, Opera 9.5+, iPhone/iPad Safari, and the Android browser. Some older versions of browsers do not support web fonts (with the @font-face CSS construct), so they have to use MathJax image font mode. The browser compatibility list is available at the official site.{{cite web |url=http://docs.mathjax.org/en/latest/misc/browser-compatibility.html |title=MathJax: Browser Compatibility |access-date=2017-06-05 |archive-url=https://web.archive.org/web/20150406062444/http://docs.mathjax.org/en/latest/misc/browser-compatibility.html |archive-date=2015-04-06 |url-status=dead }}

Plugin support

MathJax can be easily added to many popular web platforms.{{cite web |url=http://docs.mathjax.org/en/latest/misc/platforms.html |title=Using MathJax in popular web platforms |access-date=2017-06-05 |archive-url=https://web.archive.org/web/20170831180044/http://docs.mathjax.org/en/latest/misc/platforms.html |archive-date=2017-08-31 |url-status=dead }}

Node.js

MathJax can be used in Node.js since version 3;{{cite web|url=http://docs.mathjax.org/en/v3.0-latest/upgrading/whats-new-3.0.html#server-side-mathjax|title=What's New in MathJax 3}} for version 2, the MathJax-node library{{cite web|url=https://www.npmjs.com/package/mathjax-node|title=mathjax-node|date=5 June 2018 }} provides Node.js compatibility.

Equation-editor compatibility

Any MathJax equation displayed in a supported browser can be copied out in MathML or LaTeX format via "Show Math as" sub-menu if right-button clicked or control-clicked on it. Then it can be pasted in any equation editor that supports MathML or LaTeX, such as Mathematica, MathType, MathMagic, or Firemath, for re-use.{{cite web|url= http://www.mathjax.org/demos/copy-and-paste/ |title= Copy and Paste Math}}

Equations generated in MathML or LaTeX format by any 3rd party equation editor can be used in MathJax enabled web pages.

TeX support

MathJax replicates the math environment commands of LaTeX. AMS-LaTeX math commands are supported via extensions. MathJax also supports TeX macros and miscellaneous formatting like \color and \underline.{{cite web |url=http://docs.mathjax.org/en/latest/tex.html#supported-latex-commands |title=MathJax: Supported LaTeX Commands |access-date=2017-06-05 |archive-url=https://web.archive.org/web/20181216163219/http://docs.mathjax.org/en/latest/tex.html#supported-latex-commands |archive-date=2018-12-16 |url-status=dead }}

MathML support

MathJax added partial support for MathML 2.0 and some MathML 3.0 constructs in its beta 2 release. MathJax supports presentation MathML and, as of version 2.2, provides experimental support for content MathML.{{cite web |url=http://docs.mathjax.org/en/latest/mathml.html#content-mathml |title=MathJax MathML Support — MathJax 2.3 documentation |access-date=2014-02-14 |archive-url=https://web.archive.org/web/20181215174114/http://docs.mathjax.org/en/latest/mathml.html#content-mathml |archive-date=2018-12-15 |url-status=dead }}

CDN servers

The MathJax site has been providing a content delivery network (CDN) where the JavaScript needed for MathJax to work can be loaded by the browser at run time from the CDN. This simplifies the installation and ensures the latest version of the library is always used. Over time usage of the server has grown from 1.3TB per month traffic in 2011 to 70TB per month in 2017. Due to increasing cost of hosting the server, the main CDN server shut down at the end of April 2017. Alternative third party CDN servers are available.{{cite web|title=MathJax CDN shutting down on April 30, 2017|url=https://www.mathjax.org/cdn-shutting-down/|website=MathJax|date=31 March 2017}}

See also

{{Portal|Free and open-source software}}

References

{{Reflist|30em}}