Skip to content

Conversation

anand-106
Copy link

Fix KaTeX Rendering Issue

Problem

KaTeX rendering is broken for both inline math and math in tables, as reported in #1213. Mathematical expressions are not displaying with proper styling.

Root Cause

The KaTeX JavaScript library is available via the streamdown package, but the KaTeX CSS stylesheet is missing. Without the CSS, math expressions render as unstyled HTML elements.

Solution

Added the KaTeX CSS import to app/globals.css:

@import 'katex/dist/katex.min.css';

Testing

  • ✅ Inline math: $E = mc^2$ now renders properly
  • ✅ Block math: $$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$ displays correctly
  • ✅ Math in tables renders with proper styling
  • ✅ Dark/light mode compatibility maintained

Changes

  • app/globals.css: Added KaTeX CSS import

Fixes #1213

- Add @import 'katex/dist/katex.min.css' to globals.css
- Fixes broken KaTeX rendering for inline math and math in tables
- Resolves issue vercel#1213

The KaTeX JavaScript library was already available via streamdown,
but the CSS stylesheet was missing, causing math expressions to
render without proper styling.
Copy link

vercel bot commented Sep 20, 2025

@anand-106 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: broken katex rendering inline as well as in table
1 participant