# Center Align in a left-aligned environment

How do I align a particular equation to the center in a left aligned environment. I guess one benefit of left alignment is when the equations are quite long. However this question, applies in the case of a short equation in the align left environment. I use the environment below:

\usepackage[fleqn]{amsmath}


From my study, this question differs from the one being asked here

• You can use the package \usepackage{nccmath}and the environement ceqn to center your equations – RockyRock May 30 '18 at 6:26

The package nccmath allow you to center your equations in a fleqn document, here is a quick example,

\documentclass[a4paper,12pt]{article}
\usepackage[english]{babel}
\usepackage[fleqn]{amsmath}
\usepackage{nccmath}

\begin{document}

\begin{ceqn}
\begin{align}
& e = m c^{2} \\
& c^2 = a^2 +b^2
\end{align}
\end{ceqn}

\end{document}


EDIT:

It also works with a simple equation environment,

\documentclass[a4paper,12pt]{article}
\usepackage[english]{babel}
\usepackage[fleqn]{amsmath}
\usepackage{nccmath}

\begin{document}

\begin{ceqn}
$$e = m c^{2}$$
\end{ceqn}

\end{document}


Hope that helps.

Romain

• Thanks for the answer. Can \begin{ceqn} \end{ceqn} be used with ? Currently I haven't gotten a repository to download it yet. – Abdulhameed May 30 '18 at 7:09
• I have added an edit to my answer using a standard equation environment :-) – RockyRock May 30 '18 at 8:09