Because it might be useful, here’s a different example but still using the repeat/count mechanism, taken from discord
#set page(margin: 1cm, width: 10cm, height: 6cm)
#let rep-count-header = counter("my-table-header-repeat")
#let repheader(first, cont) = {
table.header(table.cell({
rep-count-header.step()
context {
if rep-count-header.get().first() == 1 {
first
} else {
cont
}
}
}))
}
#let continuation-footer(cont, stroke: none) = {
table.footer({
table.cell(inset: 0pt, stroke: none, {
rep-count-header.step()
context {
// show continuation footer if we have header continuations
// and we're not on the last one.
let s = rep-count-header.final()
let t = rep-count-header.get()
if t.first() < s.first() {
set align(right)
set block(stroke: (top: none, rest: stroke))
show: pad.with(0.45em) // manual inset
cont
} else {
// Need to make the cell "invisible" / take no space when not used
none
}
}})
})
}
#show math.equation: set block(breakable: true)
#table(
stroke: 0.2pt,
repheader([Example], [Example (cont'd)]),
{
$
[ sqrt(2)(cos pi/8 + i sin pi/8)]^12: \
[ sqrt(2)(cos pi/8 + i sin pi/8)]^12 = \
// just filler here
= [ sqrt(2)(cos pi/8 + i sin pi/8)]^12 \
= [ sqrt(2)(cos pi/8 + i sin pi/8)]^12 \
= [ sqrt(2)(cos pi/8 + i sin pi/8)]^12 \
$
},
continuation-footer(stroke: 0.2pt)[continued $->$]
)
Just because it might be simpler to extract the parts you need from a simpler example.