# why does something disappear in the aligned environment?

I noticed a strange behaviour with the aligned environment:

\label{eq:direct_limit} \begin{aligned} [x] + [y] & := [\eta_{ik}(x) + \eta_{jk}(y)],\\ [x] \cdot r & := [x \cdot r]. \end{aligned}


If I compile this, the first "[x]" in the equation is missing. Does anybody know why?

-

## 3 Answers

The [x] is misinterpreted as the optional argument for aligned. You can use a \relax:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\label{eq:direct_limit} \begin{aligned}\relax [x] + [y] & := [\eta_{ik}(x) + \eta_{jk}(y)],\\ [x] \cdot r & := [x \cdot r]. \end{aligned}

\end{document}


Instead of := you could use \coloneqq from mathtools:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\label{eq:direct_limit} \begin{aligned}\relax [x] + [y] & \coloneqq [\eta_{ik}(x) + \eta_{jk}(y)],\\ [x] \cdot r & \coloneqq [x \cdot r]. \end{aligned}

\end{document}


-

Use an empty {} to prevent [x] from getting added as optional argument of aligned.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\label{eq:direct_limit} \begin{aligned} {}[x] + [y] & := [\eta_{ik}(x) + \eta_{jk}(y)],\\ [x] \cdot r & := [x \cdot r]. \end{aligned}
\end{document}

-

A simple solution is to use mathtools package to fix the problem in \\ command and amsmath's some environments.

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\label{eq:direct_limit} \begin{aligned} [x] + [y] & := [\eta_{ik}(x) + \eta_{jk}(y)],\\ [x] \cdot r & := [x \cdot r]. \end{aligned}

\end{document}

-