How to fix math align problem

#set math.equation(numbering: "1")
$
  x = y
$

$
  & "Text" #lorem(10) \
  & x = y
$

$
  & "Text" #lorem(10) \
  x = y
$

$
  & "Text" #lorem(10) \
  & #block(width: 100%, $x = y$)
$

$
  & "Text" #lorem(10) \
  & #align(center, $x = y$)
$

If I don’t use &, all the equation will show at center, but if I use it there won’t any thing can show at center. I try block and align, th first one makes other content change, the second one, doesn’t work.

If you want to have some lines of your equation to have alignment &s, and some lines to be centered as usual, you can nest equations and have only the inner ones have &s.

#set math.equation(numbering: "1")
#show math.equation: it => {
  set math.equation(numbering: none)
  it
}

$
  "This is centered even though the rest is aligned." \
  "|" \
  #block($ x &= 2 dot pi \ & <= 123 $)
$

#align(center, "|") // for context

Notes:

  • the show rule is neccessary for the inner equation not to get its own number
  • if you have multiple such nested blocks, their respective & will be independent