tejasprabhune

tejasprabhune / kern

Public

A fast, zero-dependency JavaScript library that renders Typst math syntax to HTML/CSS/MathML in the browser. Drop-in alternative to KaTeX for projects that prefer Typst's cleaner math syntax.

10
0
100% credibility
Found May 17, 2026 at 10 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
TypeScript
AI Summary

Kern is a JavaScript library that renders mathematical equations beautifully on websites. It uses Typst's cleaner math syntax as an alternative to traditional LaTeX, making it much easier to write fractions, square roots, matrices, and complex equations. The library works directly in web browsers with no extra setup required—just add two lines to your page and start writing math in a natural, readable format. It produces both visual HTML/CSS output and accessible MathML for screen readers, making it suitable for educational content, academic blogs, and technical documentation.

How It Works

1
💻 You need math on your website

You're building a website, blog, or educational app and want to display beautiful mathematical equations without the headache.

2
You discover a simpler way

Instead of wrestling with complex LaTeX commands, you find kern—a library that lets you write math in a cleaner, more natural style.

3
📦 You add it to your page

You copy two lines to your HTML—a stylesheet and a script—and kern is ready to use instantly.

4
✍️ You write math naturally

Instead of \frac{a}{b}, you simply write frac(a, b). Instead of \sqrt{x}, you write sqrt(x). It reads like you think.

5
You choose your style
📝
Inline math

Wrap expressions in single dollar signs for math that flows naturally within your sentences.

🎯
Display math

Use double dollar signs for equations that deserve their own centered space, like theorem statements.

6
🎨 Everything looks perfect

Your equations render crisp and beautiful, working in any browser with proper accessibility support through MathML.

🎉 Your readers see beautiful math

Students, researchers, and visitors to your site enjoy perfectly rendered equations without any extra effort from you.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 10 to 10 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is kern?

Kern is a zero-dependency JavaScript library that renders Typst math syntax directly in the browser, outputting HTML/CSS and MathML. If you've ever wished math rendering had a cleaner API than LaTeX, this is for you. Instead of wrestling with `\frac{a}{b}`, you write `frac(a, b)`. The library exposes a familiar KaTeX-like API with `render()` and `renderToString()` methods, plus auto-rendering for pages full of math. It ships as an ES module, UMD, or via CDN, and supports macros, custom delimiters, and multiple output modes.

Why is it gaining traction?

The hook is Typst's syntax. LaTeX math is notoriously verbose, and KaTeX/MathJax lock you into that world. Kern lets you write math the way Typst does: `sqrt(x)` instead of `\sqrt{x}`, `x^2` instead of `x^{2}`, `vec(a, b)` instead of a multi-line pmatrix. The API is intentionally compatible with KaTeX, so migrating existing projects is straightforward. The library handles matrices, binomial coefficients, limits, accents, and stretched delimiters with a surprisingly complete feature set for something at 10 stars.

Who should use this?

Frontend developers building educational platforms, scientific blogs, or documentation sites that need math rendering. If you're already using Typst elsewhere in your stack, or if your team finds LaTeX syntax off-putting, Kern removes that friction. It's also useful for anyone wanting to reduce their dependency footprint since KaTeX bundles several fonts and helpers that Kern avoids.

Verdict

With a 1.0% credibility score and only 10 stars, this is an early-stage project that needs community validation before production use. The code is well-structured and the README is thorough, but there's no visible CI pipeline and test coverage isn't documented. The concept is solid and the Typst syntax genuinely improves DX over LaTeX. Watch this one, but hold off on betting your next release on it until it accumulates more battle-testing and contributor activity.

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.