Clever! This is a great solution.
I’d like to add an example of how I used this with the i-figured module:
#import "@preview/i-figured:0.2.4"
#set page(paper: "a7")
#set heading(numbering: "1")
#let custom-font = "Buenard"
#set text(font: custom-font)
#show heading: i-figured.reset-counters
#show math.equation: it => i-figured.show-equation(
it,
numbering: (..n) => text(
font: custom-font,
strong(numbering("(1.1)", ..n))
)
)
= Heading One
$ y = x^2 + 1 $
$ y = x^2 + 2 $
= Heading Two
*#lorem(5)*
$ y = x^2 + 3 $