How to custom math equation numbering with "=" alignment point?

I need to custom math equation numbering with equation alignment. It should look like this:

Now, I use two equations and I need to align “=” on eq.2 manually as follows:

(Note that this is just an example)

#set math.equation(number-align: bottom, numbering: "(1.1)")
$ 
  f(x)  &= (x+1)^2 \
        &= x^2 + 2x + 1 \ 
$ <eq:1>
$
  "          "= integral x^2 + 2x + 1 
$<eq:2>

Look at @eq:1, #lower([#lorem(10)]) Look at @eq:2, #lower([#lorem(10)])

How to do this using one equation only? Thank you.

You could use equate – Typst Universe which offers shared alignment blocks. Would that cancel the need to have everything in one equation only? Line numbering can also be configured.

1 Like

Oh, thank you for your suggestion.
Problem solved.

#import "@preview/equate:0.3.2": equate

#show: equate.with(breakable: true, sub-numbering: true, number-mode: "label")

Complete code required to comply exactly with your request. Note the addition of share-align and the position of <eq:1>.

#import "@preview/equate:0.3.2": equate, share-align

#show: equate.with(breakable: true, sub-numbering: false, number-mode: "label")

#set math.equation(numbering: "(1.1)")

#share-align[
  $
    f(x) & = (x+1)^2 \
         & = x^2 + 2x + 1#<eq:1>
  $
  $
    & = integral x^2 + 2x + 1
  $<eq:2>

  Look at @eq:1, #lower([#lorem(10)]) Look at @eq:2, #lower([#lorem(10)])
]

1 Like