[PR #1832] [CLOSED] Add locally bundled MathJax rendering to web chat #3706

Closed
opened 2026-11-07 15:30:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • 56063f3 web: isolate shared chat math foundation and adapter contract
  • 972b48e web: render chat math with locally bundled MathJax
  • e2f5046 docs: distinguish Docker installation from pending native TeX validation
  • 253ea8c Merge remote-tracking branch 'upstream/main' into HEAD
  • 36958b5 Merge commit '253ea8cfe5' into HEAD
  • 2dd2ddf Merge 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.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1832 **Author:** [@CC-David-CC](https://github.com/CC-David-CC) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/web-math-mathjax` --- ### 📝 Commits (6) - [`56063f3`](https://github.com/Niko1221/Strata/commit/56063f315e3975294e67ac4f9e40ef7cd5a6a5c4) web: isolate shared chat math foundation and adapter contract - [`972b48e`](https://github.com/Niko1221/Strata/commit/972b48e8f1f5ee5930762d01a89b995b93196638) web: render chat math with locally bundled MathJax - [`e2f5046`](https://github.com/Niko1221/Strata/commit/e2f5046e7e1acd7f1877598b00cefb794be4c965) docs: distinguish Docker installation from pending native TeX validation - [`253ea8c`](https://github.com/Niko1221/Strata/commit/253ea8cfe554f45f1a0ca287b9880363d3b16012) Merge remote-tracking branch 'upstream/main' into HEAD - [`36958b5`](https://github.com/Niko1221/Strata/commit/36958b5bd60e026b0bb409c00c8a00db42f525f7) Merge commit '253ea8cfe554f45f1a0ca287b9880363d3b16012' into HEAD - [`2dd2ddf`](https://github.com/Niko1221/Strata/commit/2dd2ddfa1f416f5f453c436e2896271b6c5ff43d) Merge Strata v0.1.43 into feat/web-math-mathjax ### 📊 Changes **176 files changed** (+2052 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `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_ </details> ### 📄 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](https://github.com/CC-David-CC/Strata-a5500/compare/feat/web-math-common...feat/web-math-mathjax). Usage and reproduction commands are in docs/WEB_MATH.md; measured comparisons are in docs/WEB_MATH_COMPARISON.md. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:12 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3706
No description provided.