How to partially disable alignment in specific lines of an equation?

I have 4 equations with some alignments, and i want the 5th eq-n to ignore most of the alignments of the previous four, and only pay attention to some alignments, something like:

. The closest i’ve got to is:

$
Re((2 - i) / z - (1 - 2i) / overline(z)) &-&& Im((2 + i) / z + (1 + 2i) / overline(z)) & &&lt.eq& 2 \
Re((2 - i) / z - (1 - 2i) / overline(z)) &+&& Re((2i - 1) / z + (1i - 2) / overline(z)) &&&lt.eq& 2 \
Re((2 - i) / z - (1 - 2i) / overline(z) &+&& (2i - 1) / z + (1i - 2) / overline(z)) &&&lt.eq& 2 \
Re((2 - i) / z - (1 + 2i) / z &+&& (2i - 1) / z + (- 1i - 2) / z) &&&lt.eq& 2 "       " &(Re(overline(a)) = Re(a)) \
&&& &Re((2-2i)/z) &&lt.eq& 2 \
$

, i.e. i tried to split the column of the second addendum into two - one left-aligned, one right-aligned. but as you can see, there is one extra alignment (typst kinda wants LHSs of eq-s 1-4 and eq-n 5 not to overlap):


what would be ideal for me is if eq-n 5 “ignored” all alignments except the ones next to lt.eq.

2 Likes

I have the same question

I can’t really say this is a good solution, but it does produce the output that you described:

#grid(
  columns: 4,
  // stroke: 1pt,
  align: horizon,
  gutter: .5em,
  
   $ Re((2 - i) / z - (1 - 2i) / overline(z)) $, $ - $, $ Im((2 + i) / z + (1 + 2i) / overline(z)) $, $ lt.eq 2 $,
   $ Re((2 - i) / z - (1 - 2i) / overline(z)) $, $ + $, $ Re((2i - 1) / z + (1i - 2) / overline(z)) $, $ lt.eq 2 $,
   $ Re lr(\( (2 - i) / z - (1 - 2i) / overline(z))  $, $ + $, $ lr((2i - 1) / z + (1i - 2) / overline(z) \)) $, $ lt.eq 2 $,
   $ Re lr(\( (2 - i) / z - (1 + 2i) / z) $, $ + $, $ lr((2i - 1) / z + (- 1i - 2) / z\)) $, $ lt.eq 2 $,
    [], [], grid.cell(align: right)[$(Re(overline(a)) = Re(a))$], $ lt.eq 2 $
)

The big problems with this method are

  1. It’s tedious to enter the equations
  2. Not only are there multiple equations (as opposed to one), but it is a grid
  3. Spacing is likely not consistent between this and other mutli-line equations
1 Like