Skip to content

Commit 33600cd

Browse files
committed
Fix panic when page width is auto
1 parent 541fe48 commit 33600cd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/equate.typ

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@
208208
}
209209
}
210210

211-
// Start of equation block.
212-
let x-start = here().position().x
213-
214211
// Resolve number width.
215212
let number-width = if number-width == auto {
216213
measure(number).width
@@ -236,7 +233,11 @@
236233
let gap = 0.5em
237234

238235
layout(bounds => {
239-
let space = if equation-align == center {
236+
let space = if bounds.width.pt().is-infinite() {
237+
// If we're in an unbounded container, the number is placed right next to
238+
// the equation body, with only the `gap` as spacing.
239+
0pt
240+
} else if equation-align == center {
240241
bounds.width - line-width - 2 * number-width
241242
} else {
242243
bounds.width - line-width - number-width

0 commit comments

Comments
 (0)