# To align equation

How to align the equation below with number in center of equation? And I need that the equations have same length.

\begin{aligned} VAR(X)&=\frac{1}{12m}\sum_{u \in \Omega}\left( a_{u1}^2 +a_{u2}^2 + a_{u3}^2 + a_{u1}a_{u2} + a_{u1}a_{u3} + a_{u2}a_{u3}\right) - \left[ \frac{1}{m}\sum_{u \in \Omega} \frac{a_{u1} + a_{u2} + a_{u3}}{3} \right]^2\\ VAR(Y)&=\frac{1}{12m}\sum_{u \in \Omega}\left( b_{u1}^2 +b_{u2}^2 + b_{u3}^2 + b_{u1}b_{u2} + b_{u1}b_{u3} + b_{u2}b_{u3}\right) - \left[ \frac{1}{m}\sum_{u \in \Omega} \frac{b_{u1} + b_{u2} + b_{u3}}{3} \right]^2 \label{eq:variancia_amostral_triangulo_x_y} \end{aligned}


Wrong mode.

This does the trick.... and makes VAR look less like V times A times R.

    \documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{aligned} \mathrm{VAR}(X)&=\frac{1}{12m}\sum_{u \in \Omega}\left( a_{u1}^2 +a_{u2}^2 + a_{u3}^2 + a_{u1}a_{u2} + a_{u1}a_{u3} + a_{u2}a_{u3}\right) \\ & \qquad - \left[ \frac{1}{m}\sum_{u \in \Omega} \frac{a_{u1} + a_{u2} + a_{u3}}{3} \right]^2\\ \mathrm{VAR}(Y)&=\frac{1}{12m}\sum_{u \in \Omega}\left( b_{u1}^2 +b_{u2}^2 + b_{u3}^2 + b_{u1}b_{u2} + b_{u1}b_{u3} + b_{u2}b_{u3}\right) \\ &\qquad - \left[ \frac{1}{m}\sum_{u \in \Omega} \frac{b_{u1} + b_{u2} + b_{u3}}{3} \right]^2 \end{aligned} \label{eq:variancia_amostral_triangulo_x_y}

\end{document}


• "VAR" is probably short for "variance". Since the amsmath package is being loaded, it's a good idea to define \VAR as a math operator, say, \DeclareMathOperator{\VAR}{VAR}, and then write VAR(X)=.... For an extra bonus point, don't autosize the square brackets on lines 2 and 4; instead, use \biggl[ and \biggr].
– Mico
Aug 18, 2016 at 6:21
• \label should go outside the aligned Aug 18, 2016 at 7:38
• @Mico Got told off for using \DeclareMathOperator for Value at Risk in the past.... True, that had indices as opposed to an argument, but it's no less an operator than the variance.....
– JPi
Aug 18, 2016 at 12:46
• @egreg: fixed...
– JPi
Aug 18, 2016 at 12:46