Gathering detailed insights and metrics for katex
Gathering detailed insights and metrics for katex
npm install katex
Typescript
Module System
Node Version
NPM Version
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%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
159,149,527
Last Day
391,590
Last Week
2,145,369
Last Month
8,965,557
Last Year
67,195,563
MIT License
18,811 Stars
2,187 Commits
1,209 Forks
283 Watchers
31 Branches
156 Contributors
Updated on Mar 14, 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
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
security policy file detected
Details
Reason
20 commit(s) and 14 issue activity found in the last 90 days -- score normalized to 10
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 is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
71 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-03-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 MoreLast Day
4.1%
391,590
Compared to previous day
Last Week
1.6%
2,145,369
Compared to previous week
Last Month
15.5%
8,965,557
Compared to previous month
Last Year
83.7%
67,195,563
Compared to previous year