Skip to content

Typeset block $$…$$ math in display style, not text style - #147

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

Typeset block $$…$$ math in display style, not text style#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

@manemajef
manemajef force-pushed the codex/latex-render-mode branch from 3edbb69 to 439cc81 Compare August 12, 2026 23:32
@manemajef manemajef changed the title Render LaTeX with inline and display modes Typeset block $$…$$ math in display style, not text style Aug 12, 2026
@manemajef

Copy link
Copy Markdown
Author

Superseded by #153 — same change, rebased onto current main, with the test-target split and protocol defaults cleaned up.

@manemajef manemajef closed this Aug 12, 2026
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