I have an align-environment and basically want all the Z's and all the signs (+-) left-aligned + all centered + the smallest possible/sane gap in between + numbering + labels (if possible):
Produced by the code:
I have:
\begin{align}
& Z_i(f) = R_i(f) & + i \cdot X_i(f) \label{eq:Zi} & \\
& Z_R(f)=R & +i\cdot 0 \label{eq:ZR} & \\
& Z_L(f)=0 & +i \cdot \underbrace{ 2 \pi f L }_{X_L} \label{eq:ZL} & \\
& Z_C(f)=0 & -i \cdot \underbrace{ \frac{1}{2 \pi f \cdot C} }_{X_C} & \label{eq:ZC}
\end{align}
I want:
\begin{align}
& Z_i(f) = R_i(f) & & + i \cdot X_i(f) \label{eq:Zi} & \\
& Z_R(f)=R & & +i\cdot 0 \label{eq:ZR} & \\
& Z_L(f)=0 & & +i \cdot \underbrace{ 2 \pi f L }_{X_L} \label{eq:ZL} & \\
\phantom{\hspace{5cm}} & Z_C(f)=0 & & -i \cdot \underbrace{ \frac{1}{2 \pi f \cdot C} }_{X_C} & \label{eq:ZC} \phantom{\hspace{5cm}}
\end{align}
Now I feel that the second code is not very nice (e.g. it will need adjustment of the phantom-spacing each time something is changed). Also the number of the last formula is at the wrong place.
Anyone have any suggestions?
alignat
\phantom
is to hide visible output. since\hspace
doesn't produce anything "printed", the\phantom
isn't necessary.