1

I am using fleqn for amsmath. So the euqation is default left-aligned.

Now I want to teamporarily make one equation center-aligned. How to do this?

Thank you all. enter image description here

MWE

\documentclass{article}
\usepackage{ragged2e}
\usepackage[fleqn]{amsmath}

\begin{document}
\section{left-align}
   \begin{equation}
        y = x 
   \end{equation}

\section{center-align}
    \begin{equation}
        \centering
         y = x + x
     \end{equation}

\end{document}
2

This is what the ceqn environment, from nccmath is for. Conversely, it defines a fleqn environment for temporarily left-aligned groups of equations in the default context:

\documentclass{article}
\usepackage{ragged2e}
\usepackage[fleqn]{amsmath}
\usepackage{nccmath}

\begin{document}

\section{left-align}
   \begin{equation}
        y = x
   \end{equation}

\section{center-align}

\begin{ceqn}
    \begin{equation}
        \centering
         y = x + x
     \end{equation}
\end{ceqn}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.