[Tex/LaTex] Center Equation

alignequationshorizontal alignment

Does anyone know how to center this equation?

r(P_i)=\sum\limits_{P_j \in B_{P_i}} \frac{r(P_j)}{|P_j|}

Thanks in advance

Best Answer

aligned 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:

\noindent This is left-aligned:
   \int \frac{1}{1+x^2}\, dx = \arctan x + C.
This is centered:
   \int \frac{1}{1+x^2}\, dx = \arctan x + C.

This is the output:

enter image description here

Source: this TeX.SX post.

Related Question