答案1
(即使等式 (1) 和 (3) 没有按符号对齐=
,但它们是右对齐的。)
以下解决方案重复使用了https://tex.stackexchange.com/a/633624/255231:
{\offinterlineskip
\setbox0=\vbox{\halign{\hfil$\strut#$&${}#$\hfil\cr
\noalign{\penalty0} %first \vsplit here
a&=1\cr %second \vsplit here
b&=2\cr\noalign{\nobreak}
cc&=3\cr %third \vsplit here
ddd&=4\cr}}
\setbox1=\vsplit0 to0pt %insert \splittopskip at the top of \box0
\setbox1=\vsplit0 to12pt %split off first group
\setbox1=\vbox{\unvbox1} %give \box1 its natural height
\setbox2=\vsplit0 to12pt %split off second group
\setbox2=\vbox{\unvbox2} %give \box2 its natural height
\tabskip 0pt plus1fill
\halign to\hsize{\hfil$#$&\hfil(#)\tabskip 0pt\cr
\left.\vcenter{\box1}\right.&1\cr
\left\{\vcenter{\box2}\right.&2\cr
\left.\vcenter{\box0}\right.&3\cr}}