Gathering detailed insights and metrics for katex
Gathering detailed insights and metrics for katex
Gathering detailed insights and metrics for katex
Gathering detailed insights and metrics for katex
npm install katex
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
18,459 Stars
2,157 Commits
1,183 Forks
282 Watching
31 Branches
152 Contributors
Updated on 28 Nov 2024
JavaScript (85.76%)
Perl (7.74%)
HTML (2.31%)
Python (1.24%)
SCSS (1.23%)
CSS (0.82%)
Shell (0.37%)
Makefile (0.31%)
Dockerfile (0.13%)
TeX (0.09%)
Cumulative downloads
Total Downloads
Last day
-2.9%
276,543
Compared to previous day
Last week
0.7%
1,454,593
Compared to previous week
Last month
19.1%
6,100,626
Compared to previous month
Last year
72%
53,734,357
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.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" 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.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" 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.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" 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.
The latest stable version of the package.
Stable Version
4
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
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
3 commit(s) and 7 issue activity found in the last 90 days -- score normalized to 8
Reason
Found 11/23 approved changesets -- score normalized to 4
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
66 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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