Here's an excerpt from an equation that I'm typesetting. The output is correct and looks how I want it to look.
Here's the MWE that generates this output:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\newcommand{\mC}{\mathcal}
\pagestyle{empty}
\begin{document}
\begin{equation*}
\newcommand\spaced[1]{{}#1{}}
\left. \begin{alignedat}{4}
& I_1 &\spaced-&I_2 &\spaced-&I_3 &\spaced=& 0 \\
& I_1 (-2 R_1) &\spaced+& I_2 (-R_2) && &\spaced=& \mC E_1 - \mC E_2 \\
& &&I_2 (R_2) &\spaced+& I_3 (-2 R_1) &\spaced=& \mC E_2 - \mC E_3
\end{alignedat} \right\}
\iff
\text{(more stuff here)}
\end{equation*}
\end{document}
However, I don't like having to include the \spaced
commands for each −, +, and = sign in the code.
If I don't include it, then the spacing is too tight (because alignedat
doesn't include space between columns).
Is there a cleaner way to achieve the correct spacing and alignment? Something like "force binary operator in the even-numbered columns" would be nice.
Would some sort of array environment be a better choice than alignedat
?