Pure JavaScript version of jqMath math rendering library, so doesn't require jQuery. Forked from jqMath v0.4.6 (May-2016) which is copyright 2016, Mathscribe, Inc. and released under the MIT license.
jqMath makes it easy to put formatted mathematical expressions in web pages. Use a simple TeX-like syntax to write expressions directly into your HTML. e.g.,
If $ax^2+bx+c=0$ with $a≠0$, then: $$x={-b±√{b^2-4ac}}/{2a}$$
produces the following:
jqMath-vanilla is very lightweight (38.6kB total, or 14.7kB Brotli compressed), fast and concise. It is standards-based and cross-browser, using MathML when available, else simple HTML and CSS, and avoiding pixel-map images. Thus pages load quickly, and expressions can be resized by the user, or easily passed to screen reading, graphing, or computer algebra software.
Copy the CSS & JS files to your server, and include them in the <head>
section of your page:
<!DOCTYPE html>
<html lang="en" xmlns:m="http://www.w3.org/1998/Math/MathML">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=UnifrakturMaguntia">
<link rel="stylesheet" href="jqmath-0.4.3.min.css">
<script src="jqmath-vanilla.min.js"></script>
...
</head>
The font stylesheet is only needed if you are using Fraktur letters in your maths.
See the example page for an overview, and full documentation is on the original jqMath homepage.
Math Library | Release | HTTP requests | Transfer kB | First load | Cached load | Browser support |
---|---|---|---|---|---|---|
jqMath vanilla [example page] | v0.1.0 May-2020 |
3 | 18.2 | 0.54s | 0.47s | IE6+, Edge, FF3.5+, Chrome 14+, Safari 3.1+, Opera 9+ |
jqMath+jQuery [example page] | v0.4.6 May-2016 |
8 | 81.9 | 1.03s | 0.90s | IE6+, Edge, FF2+, Chrome 16+, Safari 3+, Opera 9+ |
KaTeX1 [example page] | v0.11.1 Sep-2019 |
14 | 215.7 | 1.67s | 1.19s | IE9+, Edge, FF?, Chrome ?, Safari ?, Opera ? |
MathJax+polyfill2 [example page] | v3.0.5 Mar-2020 |
15 | 291.6 | 3.67s | 2.66s | IE11+, Edge, FF38+, Chrome 29+, Safari 9+, Opera 33+, iOS 9+, Android 4+ |
/examples/
was performed with FF76 on a desktop PC.1KaTeX can alternatively be run server-side for compatibility with all browsers
2MathJax v2.x supports older browsers including IE6-10