Jump to content

MathJax

From Wikipedia, the free encyclopedia
MathJax
Developer(s)American Mathematical Society
Stable release
3.2.2[1] / June 8, 2022;2 years ago(2022-06-08)
Preview release
4.0.0-beta.6[2] / April 30, 2024;4 months ago(2024-04-30)
Repository
Written inJavaScript
Operating systemCross-platform
TypeMathematical software
LicenseApache License2.0
Websitewww.mathjax.orgEdit this on Wikidata

MathJaxis across-browserJavaScript librarythat displaysmathematical notationinweb browsers,usingMathML,LaTeXandASCIIMathMLmarkup.[3][4][5]MathJax is released asopen-source softwareunder theApache License.

The MathJax project started in 2009 as the successor to an earlier JavaScript mathematics formatting library,jsMath,[6]and is managed by theAmerican Mathematical Society.[7]The project was founded by the American Mathematical Society, Design Science, and theSociety for Industrial and Applied Mathematicsand is supported by numerous sponsors such as theAmerican Institute of PhysicsandStack Exchange.[8]

MathJax is used by web sites includingarXiv,[9]Elsevier'sScienceDirect,[10]MathSciNet,[11]n-category cafe,MathOverflow,Wikipedia(on the backend),[12][13]Scholarpedia,Project Euclidjournals,[14]IEEEXplore,[15]Publons,Coursera,and theAll-Russian Mathematical Portal.[16]

Features

[edit]

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 extrafontson the reader's system. This allows MathJax to run in any browser with JavaScript support, including mobile devices.[17]

MathJax can display math by using a combination ofHTMLandCSSor 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 introducedSVGrendering.[18]

In the case of HTML and CSS typesetting, MathJax maximizes math display quality by usingmath fontsif available and by resorting to images for older browsers. For newer browsers that supportweb 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 validfontsare available on the user's system. If this does not work, MathJax provides images of any symbols needed.[clarification needed]MathJax can be configured to enable or disable web fonts, local fonts, and image fonts.

MathJax uses theSTIX fontsfor including mathematics in web pages. Installing the fonts on the local computer improves MathJax’s typesetting speed.[19]

MathJax can display mathematical notation written inLaTeXorMathMLmarkup. 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.[17]

MathJax also supports math accessibility by exposing MathML through its API toassistive technologysoftware, as well as the basicWAI-ARIA"role" and olderalt attributes.[20]

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

[edit]

MathJax renders math in most popular browsers, includingInternet Explorer6+,Firefox3+,Google Chrome0.3+,Safari2.0+,Opera9.5+,iPhone/iPadSafari, and theAndroidbrowser. Some older versions of browsers do not support web fonts (with the @font-faceCSSconstruct), so they have to use MathJax image font mode. The browser compatibility list is available at the official site.[21]

Plugin support

[edit]

MathJax can be easily added to many popular web platforms.[22]

Node.js

[edit]

MathJax can be used inNode.jssince version 3;[23]for version 2, the MathJax-node library[24]provides Node.js compatibility.

Equation editor compatibility

[edit]

Any MathJax equation displayed in a supported browser can be copied out inMathMLorLaTeXformat via "Show Math as" sub-menu if right-button clicked or control-clicked on it. Then it can be pasted in anyequation editorthat supports MathML or LaTeX, such asMathematica,MathType,MathMagic,Firemathfor re-using.[25]

Equations generated inMathMLorLaTeXformat by any 3rd partyequation editorcan be used in MathJax enabled web pages.

TeX support

[edit]

MathJax replicates the math environment commands of LaTeX.AMS-LaTeXmath commands are supported via extensions. MathJax also supports TeX macros and miscellaneous formatting like\colorand\underline.[26]

MathML support

[edit]

MathJax added partial support forMathML2.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.[27]

CDN servers

[edit]

The MathJax site has been providing acontent 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.[28]

See also

[edit]

References

[edit]
  1. ^"MathJax v3.2.2".MathJax.2022-06-08.
  2. ^"Releases · mathjax/MathJax".GitHub.Retrieved22 June2024.
  3. ^"MathJax: Rich Math display from LaTeX and MathML".17 November 2015.
  4. ^"MathJax AsciiMath support".Archived fromthe originalon 2018-03-23.Retrieved2013-04-07.
  5. ^Cuellar, Autumn; Topping, Paul (June 2013). Mathews, Bob (ed.)."What you need to know about the Maths Stack".XML London 2013:63–68.doi:10.14337/XMLLondon13.Cuellar01(inactive 2024-03-14).ISBN978-0-9926471-0-0.{{cite journal}}:CS1 maint: DOI inactive as of March 2024 (link)
  6. ^Hayes, Brian(2009), "Writing Math on the Web: The Web would make a dandy blackboard if only we could scribble an equation",American Scientist,92(2): 98,doi:10.1511/2009.77.98.
  7. ^"AMS becomes managing partner of the MathJax Consortium".2013-03-20.
  8. ^"MathJax Sponsorship".
  9. ^"arXiv.org help – What is MathJax?".
  10. ^"MathJax on ScienceDirect".Archived fromthe originalon 2014-08-26.Retrieved2014-08-24.
  11. ^"MathSciNet What's New".
  12. ^Schubotz, Moritz; Wicke, Gabriel (2014-01-01). "Mathoid: Robust, Scalable, Fast and Accessible Math Rendering for Wikipedia".Intelligent Computer Mathematics.Lecture Notes in Computer Science. Vol. 8543. pp. 224–235.arXiv:1404.6179.doi:10.1007/978-3-319-08434-3_17.ISBN978-3-319-08434-3.S2CID16123116.
  13. ^"Extension:Math - MediaWiki".www.mediawiki.org.Retrieved2017-04-06.
  14. ^"What is MathJax?".
  15. ^"IEEE Xplore Help".IEEE.Retrieved2021-08-05.
  16. ^"All-Russian Mathematical Portal".
  17. ^abCervone, Davide (2012),"Math Jax: A Platform for Mathematics on the Web"(PDF),Notices of the American Mathematical Society,59(2): 312–316,doi:10.1090/noti794
  18. ^"MathJax v2.0-beta now available on CDN".February 11, 2012.
  19. ^MathJax Font HelpArchived2012-07-28 at theWayback Machineaccessed 2012-08-14.
  20. ^"MathJax: Accessibility".
  21. ^"MathJax: Browser Compatibility".Archived fromthe originalon 2015-04-06.Retrieved2017-06-05.
  22. ^"Using MathJax in popular web platforms".Archived fromthe originalon 2017-08-31.Retrieved2017-06-05.
  23. ^"What's New in MathJax 3".
  24. ^"mathjax-node".5 June 2018.
  25. ^"Copy and Paste Math".
  26. ^"MathJax: Supported LaTeX Commands".Archived fromthe originalon 2018-12-16.Retrieved2017-06-05.
  27. ^"MathJax MathML Support — MathJax 2.3 documentation".Archived fromthe originalon 2018-12-15.Retrieved2014-02-14.
  28. ^"MathJax CDN shutting down on April 30, 2017".MathJax.31 March 2017.
[edit]