#Make math.equation supplement be "(#)"

8 messages · Page 1 of 1 (latest)

brisk phoenix
#

It is possible to change the prefix used for references to math equations, using:

set math.equation(supplement: "Eq.")

Is it possible to make the supplement be the equation number surrounded by parenthesis, so that instead of "Eq. 6", is would be "(6)"?

vapid apex
#

?r

#set math.equation(numbering: numbering.with("(1)"), supplement: [])
$ y = f(x) $ <eq>
@eq

You can try this.

brisk phoenix
#

oh, something that I had forgotten is that numbering is not turned on, because that adds numbers to all equations, but I'm using numbers only for specific equations, using this:

  // This is to conditionally add labels to math equations.
    show: it => context {
        let selectors = query(math.equation.where(block: true))
            .filter(it => it.has("label"))
            .map(it => math.equation.where(block: true, label: it.label))

        if selectors == ()  { return it }
        show selector.or(..selectors):  set math.equation(numbering: "(1)")
        it
    }
#

duh, I just added the numbering.with to the code I just pasted, and it worked.

#

Thank you

vapid apex
#

👍

flat lava