Skip to content

Render LaTeX with inline and display modes - #147

Draft
manemajef wants to merge 1 commit into
nodes-app:mainfrom
manemajef:codex/latex-render-mode
Draft

Render LaTeX with inline and display modes#147
manemajef wants to merge 1 commit into
nodes-app:mainfrom
manemajef:codex/latex-render-mode

Conversation

@manemajef

Copy link
Copy Markdown

Summary

  • add an explicit inline/display mode to LaTeX rendering while preserving the existing mode-less renderer API
  • route block math as display and body/table math as inline
  • map the mode to SwiftMath labelMode and include it in memory and disk cache keys
  • keep mode-less SwiftMath calls in text style

Root cause

The parser and layout already distinguished inline and block math, but both styling paths passed only delimiter-free content through LatexRenderer. SwiftMathBridge therefore had no mode information and forced every formula into text style.

Compatibility

Existing LatexRenderer conformers can continue implementing only the original method. The new mode-aware requirement has a default implementation that forwards the same delimiter-free content to that method.

Validation

  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer swift test --filter LatexRenderModeTests
  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer swift test
  • 322 tests passed across 58 suites

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.

1 participant