# How do I get a centered equation when I use \documentclass[fleqn]{article}?

Notice I want my equation to have numbering.

LaTeX (and amsmath package) do not support this as it is a rather strange request, the style of equations should almost always be a document-wide choice.

That said, if you really need this you can make use of the fact that $$ is not supported latex syntax and does not obey the fleqn option. \documentclass[fleqn]{article} \usepackage{amsmath} \begin{document} zzz $$aaa=bbb$$ zzz$$\refstepcounter{equation}$$aaa=bbb$$\eqno(\theequation)
$$zzz $$aaa=bbb$$ \end{document}  • Perhaps you should use \ifvmode \nointerlineskip \makebox[.6\linewidth]{}\fi$$ instead of just  to start the display. – Skillmon likes topanswers.xyz Aug 17 '18 at 19:50
• @Skillmon no need for the test, it is not in vmode (and should never be) latex has that test to catch user errors – David Carlisle Aug 17 '18 at 19:52

The nccmath package, which defines a fleqn environment to be used when you want to have only some equations aligned at the left margin, has, conversely, a ceqn when you want to have occasionally centred equations in a document with the fleqn option. These environments work like (and are compatible with) the subequations environment – and all amsmath environments.

Here is an example:

\documentclass[fleqn]{article}

\usepackage{amsmath, nccmath}
\usepackage{lipsum}

\begin{document}

\lipsum[11]
$$aaa=bbb$$

\begin{subequations}
\begin{ceqn}
\begin{align}
aaa & =bbb \\
aaa + c & =bbb + d
\end{align}
\end{ceqn}
\end{subequations}

\end{document}