Skip to content

sheffieldnikki/jqmath-vanilla

Repository files navigation

jQmath-vanilla

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:

Example expression

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.

Using the library

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 rendering libraries

Math LibraryReleaseHTTP
requests
Transfer
kB
First
load
Cached
load
Browser support
jqMath vanilla
[example page]
v0.1.0
May-2020
3 18.20.54s0.47sIE6+, Edge, FF3.5+, Chrome 14+, Safari 3.1+, Opera 9+
jqMath+jQuery
[example page]
v0.4.6
May-2016
8 81.91.03s0.90sIE6+, Edge, FF2+, Chrome 16+, Safari 3+, Opera 9+
KaTeX1
[example page]
v0.11.1
Sep-2019
14215.71.67s1.19sIE9+, Edge, FF?, Chrome ?, Safari ?, Opera ?
MathJax+polyfill2
[example page]
v3.0.5
Mar-2020
15291.63.67s2.66sIE11+, Edge, FF38+, Chrome 29+, Safari 9+, Opera 33+, iOS 9+, Android 4+
The download transfer size & load time-until-idle of each page in /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

About

Pure JavaScript version of lightweight jqMath math rendering library for web pages

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published