You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 204_30 Mismatched bracket sizes in multi-line formulas
2
+
3
+
## How to test
4
+
- Open Mogan editor
5
+
- Insert a display formula, use the align environment
6
+
- On the first line, enter content with `\left[` (e.g. `f(x) \leq \left[ \int dx`)
7
+
- On the second line, enter content with `\right]` (e.g. `+x \right]`)
8
+
- Verify that the bracket sizes on both lines are consistent
9
+
10
+
## 2026/03/06 Fix mismatched bracket sizes in multi-line formulas
11
+
12
+
### What
13
+
Fixed an issue where brackets (e.g. `[` and `]`) spanning multiple lines in multi-line math formulas (such as align environments) had inconsistent sizes.
14
+
15
+
### Why
16
+
Multi-line math environments are internally implemented as tables, with each row typeset as an independent cell. Each cell's bracket size was calculated based only on that row's content, making it impossible to coordinate bracket sizes across rows. For example, the first row with an integral symbol made `[` large, but the shorter content on the second row kept `]` small.
17
+
18
+
### How
19
+
Introduced a bracket-pending mechanism using environment variables, storing bracket height information per column (`math-bracket-pending-{col}`) and propagating it between table rows:
20
+
21
+
- When a row ends with an incomplete bracket pair (e.g. `<left-[>...<right-.>`), save the vertical extents of that row's content
22
+
- When the next row detects an incomplete bracket pair at the start (e.g. `<left-.>...<right-]>`), read the saved extents and merge them
23
+
- Supports brackets spanning three or more rows, with middle rows both reading and propagating pending state
24
+
25
+
Modified files:
26
+
-`src/Typeset/Concat/concat_post.cpp`: added bracket_match_state, pending state management functions, modified handle_matching and handle_brackets
27
+
-`src/Typeset/Concat/concater.hpp`: updated handle_matching function signature
0 commit comments