At ran into what at this point seems like a bug to me. When using brackets around a term before the first equality in an aligned environment, the enclosed quantity simply disappears from the output. For example, the following MWE
\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{aligned}
[a] = [b]
\end{aligned}
\end{equation}
\end{document}
yields
When reomving the first bracket, i.e. the one in front of a, everything looks as expected.
However, when reinserting the first bracket and instead removing the second one as well as those around b, i.e. with [a = b compilation is aborted and I get a nasty error stating
File ended while scanning use of \\aligned@a.
Has anyone encountered this problem before and knows of a fix?


alignedenvironment takes an optional argument, which is how your input is interpreted. You need to insert something that avoid this confusion:\relax[a]or{}[a]... – Werner Feb 19 '16 at 21:30alignedenvironment doesn't output first part in the bracket – barbara beeton Feb 19 '16 at 21:30mathtoolspackage, which with its default settings solves this problem. – sodd Feb 19 '16 at 21:33