Gathering detailed insights and metrics for katex
Gathering detailed insights and metrics for katex
npm install katex
Typescript
Module System
Node Version
NPM Version
98.8
Supply Chain
98.4
Quality
94.3
Maintenance
100
Vulnerability
99.6
License
JavaScript (85.82%)
Perl (7.71%)
HTML (2.3%)
SCSS (1.24%)
Python (1.23%)
CSS (0.81%)
Shell (0.37%)
Makefile (0.31%)
Dockerfile (0.13%)
TeX (0.09%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
150,895,225
Last Day
353,069
Last Week
1,999,056
Last Month
8,085,335
Last Year
62,431,413
MIT License
18,687 Stars
2,186 Commits
1,200 Forks
284 Watchers
31 Branches
156 Contributors
Updated on Feb 13, 2025
Minified
Minified + Gzipped
Latest Version
0.16.21
Package Id
katex@0.16.21
Unpacked Size
3.80 MB
Size
1.41 MB
File Count
206
NPM Version
10.8.2
Node Version
20.18.1
Published on
Jan 17, 2025
Cumulative downloads
Total Downloads
Last Day
-0.6%
353,069
Compared to previous day
Last Week
6.1%
1,999,056
Compared to previous week
Last Month
52.6%
8,085,335
Compared to previous month
Last Year
77.7%
62,431,413
Compared to previous year
1
74
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 11.
KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the list of supported functions.
Try out KaTeX on the demo page!
1<!DOCTYPE html> 2<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly --> 3<html> 4 <head> 5 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css" integrity="sha384-zh0CIslj+VczCZtlzBcjt5ppRcsAmDnRem7ESsYwWwg3m/OaJ2l4x7YBZl9Kxxib" crossorigin="anonymous"> 6 7 <!-- The loading of KaTeX is deferred to speed up page rendering --> 8 <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.js" integrity="sha384-Rma6DA2IPUwhNxmrB/7S3Tno0YY7sFu9WSYMCuulLhIqYSGZ2gKCJWIqhBWqMQfh" crossorigin="anonymous"></script> 9 10 <!-- To automatically render math in text elements, include the auto-render extension: --> 11 <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/contrib/auto-render.min.js" integrity="sha384-hCXGrW6PitJEwbkoStFjeJxv+fSOOQKOPbJxSfM6G5sWZjAyWhXiTIIAmQqnlLlh" crossorigin="anonymous" 12 onload="renderMathInElement(document.body);"></script> 13 </head> 14 ... 15</html>
You can also download KaTeX and host it yourself.
For details on how to configure auto-render extension, refer to the documentation.
Call katex.render
to render a TeX expression directly into a DOM element.
For example:
1katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, { 2 throwOnError: false 3});
Call katex.renderToString
to generate an HTML string of the rendered math,
e.g., for server-side rendering. For example:
1var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", { 2 throwOnError: false 3}); 4// '<span class="katex">...</span>'
Make sure to include the CSS and font files in both cases. If you are doing all rendering on the server, there is no need to include the JavaScript on the client.
The examples above use the throwOnError: false
option, which renders invalid
inputs as the TeX source code in red (by default), with the error message as
hover text. For other available options, see the
API documentation,
options documentation, and
handling errors documentation.
Learn more about using KaTeX on the website!
This project exists thanks to all the people who contribute code. If you'd like to help, see our guide to contributing code.
Become a financial contributor and help us sustain our community.
Support this project with your organization. Your logo will show up here with a link to your website.
KaTeX is licensed under the MIT License.
Stable Version
5
6.3/10
Summary
KaTeX \htmlData does not validate attribute names
Affected Versions
>= 0.12.0, <= 0.16.20
Patched Versions
0.16.21
5.5/10
Summary
KaTeX missing normalization of the protocol in URLs allows bypassing forbidden protocols
Affected Versions
>= 0.11.0, < 0.16.10
Patched Versions
0.16.10
6.3/10
Summary
KaTeX's `\includegraphics` does not escape filename
Affected Versions
>= 0.11.0, < 0.16.10
Patched Versions
0.16.10
6.5/10
Summary
KaTeX's maxExpand bypassed by Unicode sub/superscripts
Affected Versions
>= 0.15.4, < 0.16.10
Patched Versions
0.16.10
6.5/10
Summary
KaTeX's maxExpand bypassed by `\edef`
Affected Versions
>= 0.10.0-beta, < 0.16.10
Patched Versions
0.16.10
Reason
29 commit(s) and 18 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
Found 7/25 approved changesets -- score normalized to 2
Reason
dangerous workflow patterns detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
Project has not signed or included provenance with any releases.
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
67 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More