Skip to content

Commit c4557e5

Browse files
committed
[201_87] Fix LaTeX formula imports using aligned to show correct numbering format
1 parent 2d8b516 commit c4557e5

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

TeXmacs/packages/environment/env-math.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,19 @@
149149
</macro>>
150150

151151
<assign|aligned*|<\macro|body>
152-
<align*|<tformat|<arg|body>>>
152+
<tformat|<twith|table-min-cols|2>|<twith|table-max-cols|2>|<cwith|1|-1|1|1|cell-lsep|0spc>|<cwith|1|-1|1|1|cell-rsep|0.5spc>|<cwith|1|-1|-1|-1|cell-rsep|0spc>|<cwith|1|-1|-1|-1|cell-lsep|0spc>|<cwith|1|-1|1|-1|cell-bsep|0.1fn>|<cwith|1|-1|1|-1|cell-tsep|0.1fn>|<cwith|1|-1|1|1|cell-halign|r>|<cwith|1|-1|-1|-1|cell-halign|l>|<cwith|1|-1|1|-1|cell-block|no>|<arg|body>>
153153
</macro>>
154154

155155
<assign|aligned|<\macro|body>
156156
<aligned*|<tformat|<arg|body>>>
157157
</macro>>
158158

159159
<assign|alignedat*|<\macro|ncol|body>
160-
<align*|<tformat|<arg|body>>>
160+
<aligned*|<tformat|<arg|body>>>
161161
</macro>>
162162

163163
<assign|alignedat|<\macro|ncol|body>
164-
<align|<tformat|<arg|body>>>
164+
<aligned*|<tformat|<arg|body>>>
165165
</macro>>
166166

167167
<assign|flalign*|<\macro|body>

devel/201_87.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#[201_87] Fix LaTeX formula imports using "aligned" to show correct numbering format
2+
## 2026/02/25 Fix equation numbering alignment in `aligned` environment
3+
### What
4+
Redefined `aligned*`, `alignedat*`, and `alignedat` in `env-math.ts` to produce inline `tformat` tables instead of delegating to `align*`/`align`.
5+
### Why
6+
Issue #2804 : when using `aligned` inside `equation`, the equation number (1) appeared below the multi-line expression instead of vertically centered to the right. The root cause was that `aligned*` was aliased to `align*`.
7+
This caused the equation number to be appended sequentially after the block rather than inline beside it.
8+
### How
9+
Changed the body of `aligned*` from `<align*|<tformat|<arg|body>>>` to a inline `tformat` with explicit settings. This makes `aligned` behave as an inline math construct with natural width and no block wrapping, so the equation number is placed correctly to the right.

0 commit comments

Comments
 (0)