How to add fractional spacing in equation?

Hi, @quachpas, thank you very much for your answer.

I’m generally using left aligned equations in my document, but when breaking a long equation like this, I want the second line to be right aligned, i.e. automatically moved to the right as much as possible (preferably leaving some padding for the equation numbers).

This can be done approximately using manual alignment, like you demonstrated, but I would prefer a solution that automatically adapts to e.g. changing line width.

I came up with this hacky solution:

// Usefull to add right aligned lines in equations. This does break alignment points though!
#let right_align_padded(body, padding: 4em, inset: 0.4em) = {
  block(width: 100%, breakable: true, spacing: 1.2em, inset: inset, pad(right: padding - inset)[
    #set align(right)
    #show math.equation.where(block: false): math.display
    #body
  ])
}
$
  partial/(partial t) (rho' e'_"tot") + 1/a^2 bold(nabla)'  dot (e'_"tot" bold(upsilon)' + P'bold(upsilon)') \
  #right_aligned_padded[$= - rho' bold(upsilon)' dot bold(nabla) ' (1/2 a accent(a, dot.double) r^('2)) - (1/(a^(3(gamma-1))) - 1/a^2) bold(upsilon)' dot bold(nabla)' P'$]
$

But I am hoping there would be a cleaner solution.