Repository navigation
Conversation
The Preview tab wrapper carried [&_.katex]:text-[0.9em]. That utility
replaces KaTeX's own .katex { font: 1.21em } rather than scaling it, so
math rendered at 0.9x body size instead of 1.21x: about 25% smaller than
KaTeX intends next to 13px body text (11.7px vs 15.73px measured in Chrome).
Drop the override so KaTeX keeps its intended proportion; the display-math
overflow guards stay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
jacktrnr
marked this pull request as ready for review
November 23, 2026 22:23
Contributor
Author
|
Verified hands-on in the combined 0.4.1-beta test build ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2092
Problem
In the sidebar's Preview tab, LaTeX rendered noticeably smaller than the markdown text around it.
Root cause
The Preview markdown wrapper (
preview-file-view.tsx) carried[&_.katex]:text-[0.9em]. KaTeX sizes math with.katex { font: 1.21em … }in thebaselayer, because its glyphs have a small x-height. The Tailwind utility sits in theutilitieslayer, so it replaced that 1.21em instead of scaling it. Math ended up at 0.9 × body size instead of 1.21 × body size.I measured it in headless Chrome against the built app CSS, with the Preview's
text-12-regularmarkdown:.katexFix
Remove the override. The
.katex-displayoverflow guards stay. No new styling and no tokens touched.Tests
preview-katex-size.test.ts: a source-structure assertion (same pattern aspreview-find-in-sidebar.test.ts) that the Preview markdown keeps its display overflow guards and sets no font-size utility on.katexor.katex-display. It failed before the fix and passes after.bun test --conditions=solid --preload ./happydom.ts src/components/session/preview(materialized tree): 95 pass, 0 fail.refresh_manifest.mjswas run, anddrift_gate.mjsPASSES.Manual check
Open a
.mdfile that has inline math (for example$\Omega_x = 2\pi \cdot 5\,\mathrm{MHz}$) in the side panel's Preview tab. The math should now match the height of the surrounding text, as it already does in chat messages.🤖 Generated with Claude Code