Does anyone know how to center this equation?

```
\begin{align}
r(P_i)=\sum\limits_{P_j \in B_{P_i}} \frac{r(P_j)}{|P_j|}
\label{eq:sum}
\end{align}
```

Thanks in advance

Skip to content
# [Tex/LaTex] Center Equation

###### Related Question

alignequationshorizontal alignment

Does anyone know how to center this equation?

```
\begin{align}
r(P_i)=\sum\limits_{P_j \in B_{P_i}} \frac{r(P_j)}{|P_j|}
\label{eq:sum}
\end{align}
```

Thanks in advance

## Best Answer

`align`

ed equations are typically centered by default, so without more information about your preamble it's hard to know for certain what the problem is.That said, it's most likely that the problem arises from passing

`fleqn`

as an option to the document class. Removing this makes display math (including`align`

environments) centered instead of left-aligned.However, if you want to have some equations left-aligned and others centered, use the environment

`ceqn`

from the`nccmath`

package, as so:This is the output:

Source: this TeX.SX post.