dotfiles/snippets/typst_hide_eq_label.typ
2025-09-20 20:17:31 -06:00

12 lines
336 B
Text

/* Do not label equations unless they have an <identifier> */
#show: body => {
for elem in body.children {
if elem.func() == math.equation and elem.block {
let numbering = if "label" in elem.fields().keys() { "(1)" } else { none }
set math.equation(numbering: numbering)
elem
} else {
elem
}
}
}