Skip to content

docs: use MathJax SVG renderer for HTML equations#1324

Merged
schaubh merged 1 commit intodevelopfrom
fix/docs-equation-rendering
Mar 11, 2026
Merged

docs: use MathJax SVG renderer for HTML equations#1324
schaubh merged 1 commit intodevelopfrom
fix/docs-equation-rendering

Conversation

@dhutererprats
Copy link
Contributor

  • Tickets addressed: N/A (documentation rendering quality fix)
  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

This PR addresses a global HTML documentation rendering issue where some math expressions show vertically misaligned characters in certain local browser/font environments.

The issue is not module-specific. It affects equation rendering across Basilisk docs because it originates in the shared Sphinx/MathJax configuration.

What changed

  • Updated:

    • docs/source/conf.py
  • Switched MathJax output mode from CHTML to SVG:

    • mathjax_path = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"
    • mathjax3_config = {"svg": {"fontCache": "global"}}

No simulation models, algorithms, message interfaces, or unit tests are modified.

RFT (Rendering Fault Type)

RFT-Category: Documentation rendering / browser typography mismatch

Observed failure mode:

  • In some environments, multi-character math tokens can appear with alternating vertical character offsets (a “staggered” or “wavy” look).
  • Example pattern: terms such as B_{overlap} may render with inconsistent baseline alignment between letters in the subscripted token.

Why this happens:

  • MathJax CHTML rendering depends on local font metrics and browser fallback behavior.
  • Metric mismatch in fallback paths can produce visible baseline artifacts.

Why SVG fixes it:

  • MathJax SVG output uses deterministic vector glyph layout.
  • This removes dependence on local font metric fallback for equation composition and eliminates the observed vertical offset artifacts.

Scope and Impact

Affected scope

  • HTML equation rendering across Basilisk documentation pages.

Not affected

  • Runtime simulation behavior
  • C++ / Python implementation logic
  • Message payload definitions
  • Test behavior/results

Verification

Checks performed:

  • Full docs build succeeds (with the same baseline warning profile for optional components/dependencies).
  • Generated HTML now references MathJax SVG renderer (tex-svg.js).
  • Equations render consistently without the observed vertical character offset artifact.

@dhutererprats dhutererprats self-assigned this Mar 11, 2026
@dhutererprats dhutererprats added bug Something isn't working documentation Improvements or additions to documentation labels Mar 11, 2026
@dhutererprats dhutererprats force-pushed the fix/docs-equation-rendering branch from cf8c449 to f9a2a15 Compare March 11, 2026 02:27
@dhutererprats dhutererprats moved this to 👀 In review in Basilisk Mar 11, 2026
@dhutererprats dhutererprats marked this pull request as ready for review March 11, 2026 02:34
@dhutererprats dhutererprats requested a review from a team as a code owner March 11, 2026 02:34
@schaubh schaubh merged commit be9e366 into develop Mar 11, 2026
7 checks passed
@schaubh schaubh deleted the fix/docs-equation-rendering branch March 11, 2026 13:31
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Basilisk Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants