How to extend underbrace to another equation line?

Hello, I have the following equation:

$
  sum_e cal(R)_e^TT (BB_e AA_e^(-1) (SS_e - CC_e cal(R)_e Lambda) + LL_e cal(R)_e Lambda) &= 0 \
  underbrace(sum_e cal(R)_e^TT (LL_e - BB_e AA_e^(-1) CC_e) cal(R)_e, cal(A)) Lambda &= underbrace(-sum_e cal(R)_e^TT BB_e AA_e^(-1) SS_e, cal(B)) \
  cal(A) Lambda &= cal(B)
$

which is rendered like this

is there maybe a way to make the underbraces extend to the $cal(A)$ and $cal(B)$ below? Or in general is there a way (not necessarily with the same braces) to typeset this equation in a subjectively nicer way?

Thank you

Extend like this?

The OP is lacking description of the desired output.

I think the output is already nice. Depending on what you expect.

Yes, something along those lines. I don’t think the output is ugly but I really dislike repetitions so I’m looking for opinions on alternative ways to typeset this

What repetitions? Typst can’t do such diagonal typesetting in math natively. You would have to probably make a custom solution. Mannot is a really good tool for this. You can of course use rotate and move and stuff like this, but that would be a hard-coded solution that won’t adapt to the math content.

By repetitions I mean $cal(A)$ and $cal(B)$. That package looks useful, I’ll take a look, thanks

This?

That’s…not really a repetition. It’s like saying I don’t like that I have to write x on every line when solving an equation with x variable.

If you mean that 6 chars for 1 visual one is too much, then use let cA = $cal(A)$, or any other alias. Though, 1-letter aliases will have to be preceded by #.

More minimalist maybe - I was just thinking what if this was a blackboard, how might you draw it? I can see that it seems like repetition or a bit crowded if you have both the underbrace with A and the A directly below it.

code
#import "@preview/mannot:0.3.0": markhl, markul

#let mark1 = markul
#let mark2 = (body, ..args) => markul(markul(body, ..args), outset: (bottom: 2.5pt))
$
  sum_e cal(R)_e^TT (BB_e AA_e^(-1) (SS_e - CC_e cal(R)_e Lambda) + LL_e cal(R)_e Lambda) &= 0 \
  mark1(sum_e cal(R)_e^TT (LL_e - BB_e AA_e^(-1) CC_e) cal(R)_e) Lambda &= mark2(-sum_e cal(R)_e^TT BB_e AA_e^(-1) SS_e) \
  \
  mark1(cal(A)) Lambda &= mark2(cal(B))
$

whether you do this with an underline (markul) or with colors (markhl) depends on the style of the document, colorful highlight fits in certain presentations and textbooks.

1 Like

I hadn’t thought of using underlines or highlights for it. I’ll think about it a bit, thanks!