I want to align a multi-line equation so that it basically looks like this:
a = (b + c
+ d + e)
f = g
The requirements of this alignment are:
- The equal signs should be aligned.
- The beginning of "b" should be aligned with the beginning of "d".
- There should be no introduction of white space in the middle of the lines. To satisfy the alignment requirements, the whole line should be shifted horizontially.
I do not know how to accomplished this. When using the alignat environment, even putting an alignment sign (&) between the "(" and the "b" (to try to align the beginning of "b" and "d") introduces white space between them, which is not allowed.
Can this be done?
(Note: the letters are just variables for any math expression. Make sure your solution does not depend on, say, the width of "a" and "f" being the same.)
EDIT:
As my note says, the letters are just variables for any math expression to give a MWE. I am actually interested in setting d = \left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]. Qrrbrbirlbel's current solution works using the letters but not after setting d as above:

As you can see, the beginning of d matches the beginning of b, but the beginning of [ is further right than the beginning of b.
The ['s should be aligned in this example:

The source for the two images above is:
\documentclass{article}
\usepackage{mathtools} % amsmath is loaded by mathtools
\usepackage{xcolor}
\newcommand*{\gphantom}[1]{{\color[gray]{.75}#1}}
\begin{document}
\begin{align*}
a & = (b + c \\
& \hphantom{{}={} (}\mathllap{{}+{}}d + e) \\
& \hphantom{{}={} (}\mathllap{{}+{}}\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right] + e) \\
f & = g
\end{align*}
\begin{align*}
a & = (\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right] + c \\
& \hphantom{{}={} (}\mathllap{{}+{}}\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right] + e) \\
f & = g
\end{align*}
\end{document}
Solution
For clarity, simplicity, and further understanding, I am posting the (current best) solution here. This is a slight modification Qrrbrbirlbel's solution bases on his own comments.

\documentclass{article}
\usepackage{mathtools} % amsmath is loaded by mathtools
\begin{document}
\begin{align*}
a & = (\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right] + c \\
& \hphantom{{}={} (}\mathllap{{}+{}}{\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]} + e) \\
f & = g
\end{align*}
\end{document}







splitis only a matter of equation numbering (and position). Compare the output of the three answers to the linked question. – Qrrbrbirlbel Oct 20 '12 at 02:43dto the expression\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right], there is too much space between+andd. Do you know why? Can you fix it? – Tyson Williams Oct 20 '12 at 05:24[is always left-aligned to the left side of theb. Maybe you can edit your question to insert that particular point highlighting the space you consider too much and how you would want it to look like. – Qrrbrbirlbel Oct 20 '12 at 11:16\fbox. I didn't try all possible combination. Anyway, withmathtools' extra small matrices the spacing is correct, again. If you put your normal[smallmatrix]in braces it is okay, too:{\left[\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}\right]}– Qrrbrbirlbel Oct 20 '12 at 14:22{and}is a nice fix. Why is space introduced and why is it removed by using{...}? – Tyson Williams Oct 20 '12 at 14:38{}+{}and{+}.mathllapor the custom macro somehow confuses the math typesetting of LaTeX … If you want to see the added glue for yourself, compile with\usepackage{lua-visual-debug}and LuaLaTeX. – Qrrbrbirlbel Oct 20 '12 at 14:53\left...\rightproduces a so-called "inner atom", which has different spacing. The{}converts the inner atom into an ordinary atom with usual spacing. – Hendrik Vogt Oct 20 '12 at 20:53