Skip to content

Preserve layout of MathTypst capture groups - #4960

Open
behackl wants to merge 3 commits into
ManimCommunity:mainfrom
behackl:fix/mathtypst-hide-grouping
Open

Preserve layout of MathTypst capture groups#4960
behackl wants to merge 3 commits into
ManimCommunity:mainfrom
behackl:fix/mathtypst-hide-grouping

Conversation

@behackl

@behackl behackl commented Aug 25, 2026

Copy link
Copy Markdown
Member

Overview: What does this pull request change?

Fixes #4931 by making MathTypst capture groups layout-transparent. Grouped expressions now preserve their original math style, spacing, and geometry.

Motivation and Explanation: Why and how do your changes improve the library?

The previous helper wrapped groups in box, which changed their math context. This implementation renders the final expression unchanged and uses cached hide probes to identify the SVG leaves belonging to each label. It also supports nested groups, duplicate labels, and geometry such as fraction bars.

Custom Typst show rules targeting hide are not supported with capture groups.

Links to added or changed documentation pages

No documentation pages changed.

Testing

  • 117 text-mobject tests passed
  • All pre-commit hooks passed
  • The Typst release demo rendered successfully

@behackl behackl added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Aug 25, 2026
@behackl behackl changed the title Fix/mathtypst hide grouping Preserve layout of MathTypst capture groups Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bugfix Bug fix for use in PRs solving a specific issue:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MathTypst grouping can change math styling and spacing

1 participant