mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1832] [CLOSED] Add locally bundled MathJax rendering to web chat #3706
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3706
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1832
Author: @CC-David-CC
Created: 10/10/2026
Status: ❌ Closed
Base:
main← Head:feat/web-math-mathjax📝 Commits (6)
56063f3web: isolate shared chat math foundation and adapter contract972b48eweb: render chat math with locally bundled MathJaxe2f5046docs: distinguish Docker installation from pending native TeX validation253ea8cMerge remote-tracking branch 'upstream/main' into HEAD36958b5Merge commit '253ea8cfe5' into HEAD2dd2ddfMerge Strata v0.1.43 into feat/web-math-mathjax📊 Changes
176 files changed (+2052 additions, -4 deletions)
View changed files
➕
docs/WEB_MATH.md(+69 -0)➕
docs/WEB_MATH_COMPARISON.md(+91 -0)➕
docs/WEB_MATH_INTERFACE.md(+22 -0)➕
docs/web-math-results/katex-chromium.json(+81 -0)➕
docs/web-math-results/katex-firefox.json(+81 -0)➕
docs/web-math-results/katex-webkit.json(+81 -0)➕
docs/web-math-results/mathjax-chromium.json(+81 -0)➕
docs/web-math-results/mathjax-firefox.json(+81 -0)➕
docs/web-math-results/mathjax-webkit.json(+81 -0)➕
docs/web-math-results/tex-chromium.json(+82 -0)➕
docs/web-math-results/tex-firefox.json(+82 -0)➕
docs/web-math-results/tex-linux-chromium.json(+82 -0)➕
docs/web-math-results/tex-runtime.json(+15 -0)➕
docs/web-math-results/tex-webkit.json(+82 -0)➕
docs/web-math-results/tex-worker.json(+86 -0)➕
serve/fixtures/math.json(+12 -0)📝
serve/server.py(+18 -0)📝
serve/web/app.css(+8 -0)📝
serve/web/app.js(+18 -4)📝
serve/web/index.html(+4 -0)...and 80 more files
📄 Description
Depends on #1829 (shared LaTeX/web math core). This branch builds directly on that core; its commits remain visible against main until the core merges. Addresses #1769 and #1780.
Replaces the placeholder adapter with MathJax 4.1.3 and local New Computer Modern font assets. Enable Render math in Chat's sampling drawer and Apply to typeset inline and display equations. Rendering starts disabled. Code stays literal; invalid or unsupported equations retain their source. Copy, export, history, and model requests preserve the original text.
Bundles 3,204,457 bytes (about 3.20 MB) of engine/font assets, licenses, and provenance. JavaScript, dynamic font data, and fonts load from Strata without a CDN or TeX installation. Produces CommonHTML plus assistive MathML. Uses configured TeX packages, safe output options, bounded macro expansion, and per-equation macro isolation; require/autoload are disabled.
This is a separate alternative to the 0.56 MB KaTeX implementation, using the same core interface and acceptance corpus. The comparison documents syntax, size, latency, accessibility, and setup tradeoffs without claiming universal LaTeX support.
Validated in Chromium, Firefox, and Playwright WebKit on Windows, including streaming, currency/code handling, macro isolation, deadlines, stale results, source preservation, and narrow layouts. WebKit coverage is not a physical Safari/iPhone test; semantic markup checks are not a manual screen-reader audit.
Adapter-only diff. Usage and reproduction commands are in docs/WEB_MATH.md; measured comparisons are in docs/WEB_MATH_COMPARISON.md.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.